From a6e2ff808e8c3c99024b9f45dd66780b4bac8c59 Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 15 Dec 2024 00:09:05 -0500 Subject: [PATCH] Wait until leaving insert mode before showing spell signs --- lua/scrollview/signs/spell.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/scrollview/signs/spell.lua b/lua/scrollview/signs/spell.lua index 5241154..db68c29 100644 --- a/lua/scrollview/signs/spell.lua +++ b/lua/scrollview/signs/spell.lua @@ -125,6 +125,12 @@ function M.init(enable) local str = fn.getbufline(bufnr, line)[1] local spellbadword = fn.spellbadword(str) local expect_sign = spellbadword[1] ~= '' + -- Wait until leaving insert mode before showing spell signs. This way, + -- signs won't show while entering a word (which will temporarily be + -- misspelled). + if expect_sign then + return + end local idx = -1 local lines = vim.w[winid][name] if lines ~= nil then