diff options
-rw-r--r-- | script/core/diagnostics/spell-check.lua | 2 | ||||
-rw-r--r-- | script/provider/diagnostic.lua | 3 | ||||
-rw-r--r-- | script/provider/spell.lua | 6 | ||||
-rw-r--r-- | script/workspace/workspace.lua | 1 |
4 files changed, 4 insertions, 8 deletions
diff --git a/script/core/diagnostics/spell-check.lua b/script/core/diagnostics/spell-check.lua index ebdb0245..7369a235 100644 --- a/script/core/diagnostics/spell-check.lua +++ b/script/core/diagnostics/spell-check.lua @@ -6,7 +6,7 @@ local spell = require 'provider.spell' ---@async return function(uri, callback) - local text = files.getText(uri) + local text = files.getOriginText(uri) if not text then return end diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index a5a1b527..c3822087 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -594,7 +594,8 @@ files.watch(function (ev, uri) ---@async end) config.watch(function (uri, key, value, oldValue) - if key:find 'Lua.diagnostics' then + if util.stringStartWith(key, 'Lua.diagnostics') + or util.stringStartWith(key, 'Lua.spell') then if value ~= oldValue then m.diagnosticsScope(uri) m.refreshClient() diff --git a/script/provider/spell.lua b/script/provider/spell.lua index 3909ddd2..6647bbad 100644 --- a/script/provider/spell.lua +++ b/script/provider/spell.lua @@ -50,10 +50,4 @@ function m.initDictionary() pformatting.updateNonStandardSymbols(config.get(nil, "Lua.runtime.nonstandardSymbol")) end -config.watch(function (uri, key, value, oldValue) - if key == 'Lua.spell.dict' and uri ~= nil then - diagnostics.refresh(uri) - end -end) - return m diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 9620f8a8..74e16096 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -518,6 +518,7 @@ end config.watch(function (uri, key, value, oldValue) if key:find '^Lua.runtime' or key:find '^Lua.workspace' + or key:find '^Lua.type' or key:find '^files' then if value ~= oldValue then m.reload(scope.getScope(uri)) |