From dbe8528231f61717210f796c93c85b852b760b33 Mon Sep 17 00:00:00 2001 From: Tobias Pisani Date: Fri, 23 Feb 2024 16:53:30 +0100 Subject: Make insert repeat (.) more consistent Insert repeat will now only record non-synthesized keys, and when played back execute mappings as well. Constructing some tests, and with the specific goal of fixing https://github.com/alexherbo2/auto-pairs.kak/issues/38, this appeared to be the best approach. Other options could be evaluating the maps only when recording, but this gave other issues (see tests/normal/repeat-insert/repeat-insert-mapped) At this point, repeat-insert may be essentially just a hardcoded macro, at least I haven't identified the difference. If this really is the case, it may make sense to give it a dedicated register, and implement it as a macro. Fixes #3600 --- test/normal/repeat-insert/cmd | 1 - test/normal/repeat-insert/out | 1 - test/normal/repeat-insert/repeat-insert-hooks/cmd | 1 + test/normal/repeat-insert/repeat-insert-hooks/out | 1 + test/normal/repeat-insert/repeat-insert-mapped/cmd | 1 + test/normal/repeat-insert/repeat-insert-mapped/out | 1 + test/normal/repeat-insert/repeat-insert-mapped/rc | 1 + test/normal/repeat-insert/repeat-insert/cmd | 1 + test/normal/repeat-insert/repeat-insert/out | 1 + test/normal/repeat-insert/repeat-normal-exec/cmd | 1 + test/normal/repeat-insert/repeat-normal-exec/out | 1 + test/normal/repeat-insert/repeat-normal-movement/cmd | 1 + test/normal/repeat-insert/repeat-normal-movement/out | 1 + 13 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 test/normal/repeat-insert/cmd delete mode 100644 test/normal/repeat-insert/out create mode 100644 test/normal/repeat-insert/repeat-insert-hooks/cmd create mode 100644 test/normal/repeat-insert/repeat-insert-hooks/out create mode 100644 test/normal/repeat-insert/repeat-insert-mapped/cmd create mode 100644 test/normal/repeat-insert/repeat-insert-mapped/out create mode 100644 test/normal/repeat-insert/repeat-insert-mapped/rc create mode 100644 test/normal/repeat-insert/repeat-insert/cmd create mode 100644 test/normal/repeat-insert/repeat-insert/out create mode 100644 test/normal/repeat-insert/repeat-normal-exec/cmd create mode 100644 test/normal/repeat-insert/repeat-normal-exec/out create mode 100644 test/normal/repeat-insert/repeat-normal-movement/cmd create mode 100644 test/normal/repeat-insert/repeat-normal-movement/out (limited to 'test/normal/repeat-insert') diff --git a/test/normal/repeat-insert/cmd b/test/normal/repeat-insert/cmd deleted file mode 100644 index 607416f6..00000000 --- a/test/normal/repeat-insert/cmd +++ /dev/null @@ -1 +0,0 @@ -ifoo. diff --git a/test/normal/repeat-insert/out b/test/normal/repeat-insert/out deleted file mode 100644 index 55b5f1fc..00000000 --- a/test/normal/repeat-insert/out +++ /dev/null @@ -1 +0,0 @@ -foofoo 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}ifoo.\.\ifoo. 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. 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 'gh' diff --git a/test/normal/repeat-insert/repeat-insert/cmd b/test/normal/repeat-insert/repeat-insert/cmd new file mode 100644 index 00000000..607416f6 --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert/cmd @@ -0,0 +1 @@ +ifoo. diff --git a/test/normal/repeat-insert/repeat-insert/out b/test/normal/repeat-insert/repeat-insert/out new file mode 100644 index 00000000..55b5f1fc --- /dev/null +++ b/test/normal/repeat-insert/repeat-insert/out @@ -0,0 +1 @@ +foofoo 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:execute-keys foo. 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 @@ +ifooghbar. 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 -- cgit v1.2.3