diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 00:59:36 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 19:49:04 +0100 |
| commit | bf98b38afd5338f6be617cfaf4bb251eb011e2b0 (patch) | |
| tree | 7832efaa75e4a6da23d57cf2672d60ce59c779d7 /src/input_handler.cc | |
| parent | db423e4a88be8799ce0cfae33ddbf4c6bae97e5f (diff) | |
Use a plain SelectionList for Context, remove DynamicSelectionList
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 62e3068f..08cd7f44 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -764,6 +764,7 @@ private: size_t index = std::min(i, strings.size()-1); buffer.insert(buffer.iterator_at(selections[i].cursor()), strings[index]); + selections.update(); } } @@ -771,8 +772,12 @@ private: { auto str = codepoint_to_str(key); auto& buffer = context().buffer(); - for (auto& sel : context().selections()) + auto& selections = context().selections(); + for (auto& sel : selections) + { buffer.insert(buffer.iterator_at(sel.cursor()), str); + selections.update(); + } context().hooks().run_hook("InsertChar", str, context()); } @@ -829,6 +834,8 @@ private: anchor = buffer.char_prev(anchor); if (buffer.is_end(cursor)) cursor = buffer.char_prev(cursor); + + selections.update(); sel.anchor() = anchor; sel.cursor() = cursor; } |
