diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 12:12:38 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 14:16:16 +0800 |
commit | a0b912c6ecd4bbbcf3ebdf7c1d4e60acaa7019cb (patch) | |
tree | 61611194b4218e52ba220abb947c9efe90f914d5 | |
parent | 64ccfdaafef56b451e3a5eed94367fad93978ec8 (diff) | |
download | rneovim-a0b912c6ecd4bbbcf3ebdf7c1d4e60acaa7019cb.tar.gz rneovim-a0b912c6ecd4bbbcf3ebdf7c1d4e60acaa7019cb.tar.bz2 rneovim-a0b912c6ecd4bbbcf3ebdf7c1d4e60acaa7019cb.zip |
vim-patch:8.1.2048: not clear why SafeState and SafeStateAgain are not triggered
Problem: Not clear why SafeState and SafeStateAgain are not triggered.
Solution: Add log statements.
https://github.com/vim/vim/commit/37d1807a801d5296f00b3ac85a38b26cfe6de55c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/state.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index 0e12c34348..89e4b9cbbf 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -282,6 +282,11 @@ void may_trigger_safestate(bool safe) && !using_script() && !global_busy; + if (was_safe != is_safe) { + // Only log when the state changes, otherwise it happens at nearly + // every key stroke. + DLOG(is_safe ? "Start triggering SafeState" : "Stop triggering SafeState"); + } if (is_safe) { apply_autocmds(EVENT_SAFESTATE, NULL, NULL, false, curbuf); } @@ -293,5 +298,8 @@ void may_trigger_safestate(bool safe) /// may_trigger_safestate(). void state_no_longer_safe(void) { + if (was_safe) { + DLOG("safe state reset"); + } was_safe = false; } |