diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-02-28 08:58:45 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-02-28 08:58:45 +1100 |
| commit | e56ffd9d3659a4f74133e5d137bb56459d838cfd (patch) | |
| tree | 29413ae40cc764b827fa6d5ca89b62f2b233e9a9 | |
| parent | 88aff72bc8c9b2c0adb20ff2da8c1d898ab4c91b (diff) | |
| parent | dbe8528231f61717210f796c93c85b852b760b33 (diff) | |
Merge remote-tracking branch 'topisani/fix-3600'
| -rw-r--r-- | src/input_handler.cc | 7 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert-hooks/cmd | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert-hooks/out | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert-mapped/cmd | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert-mapped/out | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert-mapped/rc | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert/cmd (renamed from test/normal/repeat-insert/cmd) | 0 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-insert/out (renamed from test/normal/repeat-insert/out) | 0 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-normal-exec/cmd | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-normal-exec/out | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-normal-movement/cmd | 1 | ||||
| -rw-r--r-- | test/normal/repeat-insert/repeat-normal-movement/out | 1 |
12 files changed, 13 insertions, 3 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 17e72874..9d81f711 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -1582,7 +1582,7 @@ void InputHandler::repeat_last_insert() // refill last_insert, this is very inefficient, but necessary at the moment // to properly handle insert completion m_last_insert.keys.push_back(key); - current_mode().handle_key(key, true); + handle_key(key); } kak_assert(dynamic_cast<InputModes::Normal*>(¤t_mode()) != nullptr); } @@ -1655,11 +1655,12 @@ void InputHandler::handle_key(Key key) auto dec = on_scope_end([this]{ --m_handle_key_level;} ); auto process_key = [&](Key key, bool synthesized) { - if (m_last_insert.recording) - m_last_insert.keys.push_back(key); current_mode().handle_key(key, synthesized); }; + if (m_last_insert.recording and m_handle_key_level <= 1) + m_last_insert.keys.push_back(key); + const auto keymap_mode = current_mode().keymap_mode(); KeymapManager& keymaps = m_context.keymaps(); if (keymaps.is_mapped(key, keymap_mode) and not m_context.keymaps_disabled()) diff --git a/test/normal/repeat-insert/repeat-insert-hooks/cmd b/test/normal/repeat-insert/repeat-insert-hooks/cmd new file mode 100644 index 00000000..a72627ce --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert-hooks/cmd @@ -0,0 +1 @@ +:hook -group h g InsertChar f %{exec FINSERTED}<ret>ifoo<esc>.\.\ifoo<esc>. diff --git a/test/normal/repeat-insert/repeat-insert-hooks/out b/test/normal/repeat-insert/repeat-insert-hooks/out new file mode 100644 index 00000000..7f03fc89 --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert-hooks/out @@ -0,0 +1 @@ +fFINSERTEDoofFINSERTEDoofoofoofoo diff --git a/test/normal/repeat-insert/repeat-insert-mapped/cmd b/test/normal/repeat-insert/repeat-insert-mapped/cmd new file mode 100644 index 00000000..d29da756 --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert-mapped/cmd @@ -0,0 +1 @@ +ixyz<esc>. diff --git a/test/normal/repeat-insert/repeat-insert-mapped/out b/test/normal/repeat-insert/repeat-insert-mapped/out new file mode 100644 index 00000000..37718976 --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert-mapped/out @@ -0,0 +1 @@ +zzxx diff --git a/test/normal/repeat-insert/repeat-insert-mapped/rc b/test/normal/repeat-insert/repeat-insert-mapped/rc new file mode 100644 index 00000000..6c1d2d04 --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert-mapped/rc @@ -0,0 +1 @@ +map global insert y '<a-;>gh' diff --git a/test/normal/repeat-insert/cmd b/test/normal/repeat-insert/repeat-insert/cmd index 607416f6..607416f6 100644 --- a/test/normal/repeat-insert/cmd +++ b/test/normal/repeat-insert/repeat-insert/cmd diff --git a/test/normal/repeat-insert/out b/test/normal/repeat-insert/repeat-insert/out index 55b5f1fc..55b5f1fc 100644 --- a/test/normal/repeat-insert/out +++ b/test/normal/repeat-insert/repeat-insert/out diff --git a/test/normal/repeat-insert/repeat-normal-exec/cmd b/test/normal/repeat-insert/repeat-normal-exec/cmd new file mode 100644 index 00000000..d077660b --- /dev/null +++ b/test/normal/repeat-insert/repeat-normal-exec/cmd @@ -0,0 +1 @@ +i<a-;>:execute-keys foo<ret><esc>. diff --git a/test/normal/repeat-insert/repeat-normal-exec/out b/test/normal/repeat-insert/repeat-normal-exec/out new file mode 100644 index 00000000..55b5f1fc --- /dev/null +++ b/test/normal/repeat-insert/repeat-normal-exec/out @@ -0,0 +1 @@ +foofoo diff --git a/test/normal/repeat-insert/repeat-normal-movement/cmd b/test/normal/repeat-insert/repeat-normal-movement/cmd new file mode 100644 index 00000000..5a536286 --- /dev/null +++ b/test/normal/repeat-insert/repeat-normal-movement/cmd @@ -0,0 +1 @@ +ifoo<a-;>ghbar<esc>. diff --git a/test/normal/repeat-insert/repeat-normal-movement/out b/test/normal/repeat-insert/repeat-normal-movement/out new file mode 100644 index 00000000..8faa240e --- /dev/null +++ b/test/normal/repeat-insert/repeat-normal-movement/out @@ -0,0 +1 @@ +barbarfoofoo |
