diff options
| author | Maxime Coste <mawww@kakoune.org> | 2021-10-10 10:28:34 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2021-10-10 11:02:09 +1100 |
| commit | 689553c2e9b953a9d3822528d4ad858af95fb6a2 (patch) | |
| tree | 1415eb0f4a733f278caf2c717340859f269c0989 /src/input_handler.hh | |
| parent | b609adc84c1bb3251d3e410a3555aa9f94cc769f (diff) | |
Split InsertMode into InsertMode and PasteMode
They are quite different use cases, and this allow moving InsertMode
to input_handler.hh which is what uses it.
This also cleans up the code as we can get rid of get_insert_pos and
rely more on SelectionList::for_each.
Diffstat (limited to 'src/input_handler.hh')
| -rw-r--r-- | src/input_handler.hh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh index bd9c3dcb..5cb150b5 100644 --- a/src/input_handler.hh +++ b/src/input_handler.hh @@ -44,12 +44,21 @@ constexpr bool with_bit_ops(Meta::Type<PromptFlags>) { return true; } using KeyCallback = std::function<void (Key, Context&)>; class InputMode; -enum class InsertMode : unsigned; enum class KeymapMode : char; enum class CursorMode; using PromptCompleter = std::function<Completions (const Context&, CompletionFlags, StringView, ByteCount)>; +enum class InsertMode : unsigned +{ + Insert, + Append, + Replace, + InsertAtLineBegin, + AppendAtLineEnd, + OpenLineBelow, + OpenLineAbove +}; class InputHandler : public SafeCountable { |
