aboutsummaryrefslogtreecommitdiff
path: root/spellcheck.lua
diff options
context:
space:
mode:
authorTopoetry <leo.tisane@disroot.org>2025-02-26 00:15:55 +0100
committerfischerling <github@muhq.space>2025-03-09 19:04:58 +0000
commit5f11dae4b32ae288951bda63e4936815ec2e4087 (patch)
tree482f886654bf092a0816708aa50f26230e639513 /spellcheck.lua
parent313873704112d53dbbc5975768c8a9adb916c515 (diff)
downloadvis-spellcheck-5f11dae4b32ae288951bda63e4936815ec2e4087.tar.gz
vis-spellcheck-5f11dae4b32ae288951bda63e4936815ec2e4087.zip
Makes :spell and :spell+ avaible
Diffstat (limited to 'spellcheck.lua')
-rw-r--r--spellcheck.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 3062d5c..3737a3e 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -470,4 +470,18 @@ vis:command_register('spelllang', function()
vis:info('The spellchecking language is ' .. spellcheck.get_lang())
end, 'Print the language used for spellchecking')
+vis:command_register('spell+', function()
+ enable_spellcheck()
+end, 'Enable spellchecking')
+
+vis:command_register('spell', function()
+ if not is_spellcheck_enabled() then
+ enable_spellcheck()
+ else
+ disable_spellcheck()
+ vis.win:draw()
+ end
+ return 0
+end, 'Toggle spellchecking in the current window')
+
return spellcheck