diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-05-23 10:14:09 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-05-23 10:14:09 +1000 |
| commit | d5fc4454551d4d9ee462d1291057a016fbfe3882 (patch) | |
| tree | 56d7e0a943490f36298e0cd0137b8527283d788b /test | |
| parent | b0f541aae65c06f828245e6f90a40967f8e98322 (diff) | |
Disable BufSetOption hook during buffer registration
The hook is manually triggred at the end of registration, by
disabling it we avoid the hook being potentially called multiple
times due to interaction with other hooks.
Fixes #5324
Diffstat (limited to 'test')
4 files changed, 7 insertions, 0 deletions
diff --git a/test/regression/5324-BufSetOption-triggers-twice/cmd b/test/regression/5324-BufSetOption-triggers-twice/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/5324-BufSetOption-triggers-twice/cmd @@ -0,0 +1 @@ + diff --git a/test/regression/5324-BufSetOption-triggers-twice/in b/test/regression/5324-BufSetOption-triggers-twice/in new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/5324-BufSetOption-triggers-twice/in @@ -0,0 +1 @@ + diff --git a/test/regression/5324-BufSetOption-triggers-twice/out b/test/regression/5324-BufSetOption-triggers-twice/out new file mode 100644 index 00000000..00463676 --- /dev/null +++ b/test/regression/5324-BufSetOption-triggers-twice/out @@ -0,0 +1 @@ +hook-ran diff --git a/test/regression/5324-BufSetOption-triggers-twice/rc b/test/regression/5324-BufSetOption-triggers-twice/rc new file mode 100644 index 00000000..debaad8a --- /dev/null +++ b/test/regression/5324-BufSetOption-triggers-twice/rc @@ -0,0 +1,4 @@ +hook global BufCreate .*/foo %{ set buffer filetype foo } +hook global BufSetOption filetype=foo %{ exec -buffer out ihook-ran<esc> } +edit foo +delete-buffer foo |
