aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/state.c8
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;
}