summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-03-30 10:38:56 +0100
committerMaxime Coste <mawww@kakoune.org>2017-03-30 10:38:56 +0100
commit2cfe3cae36cb9054b37a351de0d7b60a0e5bd4ca (patch)
treeab807ceffc30c6bc045c30668e519a4834c600d6 /src/input_handler.cc
parentfa7f29a1205d8dcbce1e10a171eb64a11774f7d8 (diff)
Add an InsertDelete hook
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index b25e4174..b9a1653c 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -1067,8 +1067,14 @@ public:
auto pos = sel.cursor();
sels.emplace_back(buffer.char_prev(pos));
}
+ auto& main = context().selections().main();
+ String main_char = buffer.string(buffer.char_prev(main.cursor()),
+ main.cursor());
if (not sels.empty())
SelectionList{buffer, std::move(sels)}.erase();
+
+ if (not main_char.empty())
+ context().hooks().run_hook("InsertDelete", main_char, context());
}
else if (key == Key::Delete)
{