diff options
author | jgmdev <jgmdev@gmail.com> | 2022-03-11 07:14:43 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2022-05-22 13:16:10 -0400 |
commit | fb40e73fcd01e044ac6c8b9d9fee1230d7a98c93 (patch) | |
tree | 8fb32486155bde3eb33625d4a14941f315b5673a | |
parent | 6c7cb500350377e89a930228747c4aa5f13e8716 (diff) | |
download | lite-xl-plugins-fb40e73fcd01e044ac6c8b9d9fee1230d7a98c93.tar.gz lite-xl-plugins-fb40e73fcd01e044ac6c8b9d9fee1230d7a98c93.zip |
spellcheck: added toggle command
-rw-r--r-- | plugins/spellcheck.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 30e16c9..566bd3e 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -8,6 +8,7 @@ local DocView = require "core.docview" local Doc = require "core.doc" config.plugins.spellcheck = common.merge({ + enable = true, files = { "%.txt$", "%.md$", "%.markdown$" }, dictionary_file = PLATFORM == "Windows" and EXEDIR .. "/words.txt" @@ -66,6 +67,8 @@ function DocView:draw_line_text(idx, x, y) draw_line_text(self, idx, x, y) if + not config.plugins.spellcheck.enable + or not words or not matches_any(self.doc.filename or "", config.plugins.spellcheck.files) @@ -118,6 +121,10 @@ end command.add("core.docview", { + ["spell-check:toggle"] = function() + config.plugins.spellcheck.enable = not config.plugins.spellcheck.enable + end, + ["spell-check:add-to-dictionary"] = function() local word = get_word_at_caret() if words[word] then |