From 77590fe2e864fbde37067f341b6767c4f043dbed Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 14 Dec 2013 14:08:26 +0000 Subject: Move (keep|flip|remove|clear)_selections from editor method to free selectors --- src/normal.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 148b0369..219df354 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1055,10 +1055,10 @@ KeyMap keymap = { ':', command }, { '|', pipe }, - { ' ', [](Context& context, int count) { if (count == 0) context.editor().clear_selections(); - else context.editor().keep_selection(count-1); } }, - { alt(' '), [](Context& context, int count) { if (count == 0) context.editor().flip_selections(); - else context.editor().remove_selection(count-1); } }, + { ' ', [](Context& context, int count) { if (count == 0) context.editor().select(clear_selections); + else context.editor().select(std::bind(keep_selection, _1, _2, count-1)); } }, + { alt(' '), [](Context& context, int count) { if (count == 0) context.editor().select(flip_selections); + else context.editor().select(std::bind(remove_selection, _1, _2, count-1)); } }, { 'w', repeated(select(select_to_next_word)) }, { 'e', repeated(select(select_to_next_word_end)) }, { 'b', repeated(select(select_to_previous_word)) }, -- cgit v1.2.3