From 6e708d2119ce0c839a89858a42a6b124a5cf48f4 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Thu, 22 Dec 2016 13:43:06 -0500 Subject: Implement visual component of mouse selections This adds the ability to click and drag with the mouse and have the effect of visually selecting text. The ability to copy the selection into a clipboard buffer is not yet implemented. --- src/grid.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/grid.rs') diff --git a/src/grid.rs b/src/grid.rs index d8b701b9..07255cb4 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -24,10 +24,16 @@ use std::borrow::ToOwned; use std::cmp::Ordering; use std::iter::IntoIterator; use std::ops::{Deref, DerefMut, Range, RangeTo, RangeFrom, RangeFull, Index, IndexMut}; +use std::ops::RangeInclusive; use std::slice::{self, Iter, IterMut}; use index::{self, Cursor}; +/// Convert a type to a linear index range. +pub trait ToRange { + fn to_range(&self, columns: index::Column) -> RangeInclusive; +} + /// Represents the terminal display contents #[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] pub struct Grid { -- cgit v1.2.3-54-g00ecf