aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Seifferth <frankseifferth@posteo.net>2021-10-07 15:46:58 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2021-10-07 16:24:15 +0200
commitab9391b4cacf22473408e7d5eba8ace4f5fefda4 (patch)
tree890d9f437ab8ac6305132b53d330ae2290e05728
parent5109c41cf37c4ac2868491a6cad7faeae96973e5 (diff)
downloadvis-spellcheck-ab9391b4cacf22473408e7d5eba8ace4f5fefda4.tar.gz
Add 'spelllang' command to print the current value
To me, this seems pretty useful for debugging purposes. It might also be of general interest to the curious user.
-rw-r--r--spellcheck.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 1771f7f..91acf31 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -6,6 +6,7 @@ if os.getenv('LANG') then
else
spellcheck.default_lang = 'en_US'
end
+
spellcheck.get_lang = function ()
if vis.win.file.spell_language then
return vis.win.file.spell_language
@@ -13,6 +14,7 @@ spellcheck.get_lang = function ()
return spellcheck.default_lang
end
end
+
local supress_stdout = ' >/dev/null'
local supress_stderr = ' 2>/dev/null'
local supress_output = supress_stdout .. supress_stderr
@@ -435,4 +437,8 @@ vis:option_register('spelllang', 'string', function(value)
return true
end, 'The language used for spellchecking')
+vis:command_register('spelllang', function()
+ vis:info('The spellchecking language is ' .. spellcheck.get_lang())
+end, 'Print the language used for spellchecking')
+
return spellcheck