More selection actions: (Ctrl +) Shift + Left/Right, Shift + Home/End
This commit is contained in:
parent
c47e30e960
commit
0d8d236be6
2 changed files with 45 additions and 5 deletions
|
|
@ -58,7 +58,11 @@ impl Cursor {
|
|||
/* expand/shrink selection */
|
||||
// TODO: (whole section): Return State::Cursor if start == end after operation
|
||||
pub fn select_range(&mut self, start: usize, end: usize) {
|
||||
self.state = State::Selection { start, end };
|
||||
if start != end {
|
||||
self.state = State::Selection { start, end };
|
||||
} else {
|
||||
self.state = State::Index(start);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn select_left(&mut self) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue