summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-14 14:08:26 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-14 14:38:17 +0000
commit77590fe2e864fbde37067f341b6767c4f043dbed (patch)
treef0a95aae43195b7150d4a4eb8f8ddddfb7c11c33 /src/normal.cc
parentdad27fe1a0d3cf7382675e9fb2c64a0a4f874a59 (diff)
Move (keep|flip|remove|clear)_selections from editor method to free selectors
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc8
1 files changed, 4 insertions, 4 deletions
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<SelectMode::Replace>(select_to_next_word<Word>)) },
{ 'e', repeated(select<SelectMode::Replace>(select_to_next_word_end<Word>)) },
{ 'b', repeated(select<SelectMode::Replace>(select_to_previous_word<Word>)) },