Collapse cursors command (;).
This commit is contained in:
parent
5945815d97
commit
77d75d9275
2 changed files with 8 additions and 0 deletions
helix-view/src
|
@ -168,6 +168,13 @@ pub fn change_selection(view: &mut View, count: usize) {
|
|||
insert_mode(view, count);
|
||||
}
|
||||
|
||||
pub fn collapse_selection(view: &mut View, _count: usize) {
|
||||
view.state.selection = view
|
||||
.state
|
||||
.selection
|
||||
.transform(|range| Range::new(range.head, range.head))
|
||||
}
|
||||
|
||||
// insert mode:
|
||||
// first we calculate the correct cursors/selections
|
||||
// then we just append at each cursor
|
||||
|
|
|
@ -134,6 +134,7 @@ pub fn default() -> Keymaps {
|
|||
vec![key!('d')] => commands::delete_selection,
|
||||
vec![key!('c')] => commands::change_selection,
|
||||
vec![key!('s')] => commands::split_selection_on_newline,
|
||||
vec![key!(';')] => commands::collapse_selection,
|
||||
vec![Key {
|
||||
code: KeyCode::Esc,
|
||||
modifiers: Modifiers::NONE
|
||||
|
|
Loading…
Add table
Reference in a new issue