diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-11-02 08:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 08:10:57 +0100 |
commit | 9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch) | |
tree | 725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/spellcheck.lua | |
parent | 49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff) | |
download | lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip |
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/spellcheck.lua')
-rw-r--r-- | plugins/spellcheck.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index f55cf1f..29db94c 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -181,7 +181,7 @@ command.add("core.docview", { end, - ["spell-check:replace"] = function() + ["spell-check:replace"] = function(dv) local word, s, e = get_word_at_caret() -- find suggestions @@ -202,7 +202,7 @@ command.add("core.docview", { -- sort suggestions table and convert to properly-capitalized text table.sort(suggestions, function(a, b) return a.diff < b.diff end) - local doc = core.active_view.doc + local doc = dv.doc local line = doc:get_selection() local has_upper = doc.lines[line]:sub(s, s):match("[A-Z]") for k, v in pairs(suggestions) do |