mirror of https://github.com/helix-editor/helix
Collapse cursors command (;).
parent
5945815d97
commit
77d75d9275
|
@ -168,6 +168,13 @@ pub fn change_selection(view: &mut View, count: usize) {
|
||||||
insert_mode(view, count);
|
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:
|
// insert mode:
|
||||||
// first we calculate the correct cursors/selections
|
// first we calculate the correct cursors/selections
|
||||||
// then we just append at each cursor
|
// then we just append at each cursor
|
||||||
|
|
|
@ -134,6 +134,7 @@ pub fn default() -> Keymaps {
|
||||||
vec![key!('d')] => commands::delete_selection,
|
vec![key!('d')] => commands::delete_selection,
|
||||||
vec![key!('c')] => commands::change_selection,
|
vec![key!('c')] => commands::change_selection,
|
||||||
vec![key!('s')] => commands::split_selection_on_newline,
|
vec![key!('s')] => commands::split_selection_on_newline,
|
||||||
|
vec![key!(';')] => commands::collapse_selection,
|
||||||
vec![Key {
|
vec![Key {
|
||||||
code: KeyCode::Esc,
|
code: KeyCode::Esc,
|
||||||
modifiers: Modifiers::NONE
|
modifiers: Modifiers::NONE
|
||||||
|
|
Loading…
Reference in New Issue