diff options
-rw-r--r-- | Readme.md | 4 | ||||
-rw-r--r-- | spellcheck.lua | 3 |
2 files changed, 5 insertions, 2 deletions
@@ -16,7 +16,7 @@ A spellchecking lua plugin for the [vis editor](https://github.com/martanne/vis) ## configuration -The module table returned from `require(...)` has three configuration options: +The module table returned from `require(...)` has some configuration options: * `cmd`: cmd that is passed to popen() and must return word corrections in Ispell format. * default: `enchant -d %s` @@ -24,6 +24,8 @@ The module table returned from `require(...)` has three configuration options: * default: `enchant -l -d %s` * `lang`: The name of the used dictionary. `lang` is inserted in the cmd-strings at `%s`. * default: `$LANG` or `en_US` +* `typo_style`: The style string with which misspellings should be highlighted + * default: `fore:red` A possible configuration could look like this: diff --git a/spellcheck.lua b/spellcheck.lua index 9f57c26..a6879b8 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -20,6 +20,7 @@ else return nil end +spellcheck.typo_style = "fore:red" spellcheck.enabled = {} local ignored = {} @@ -27,7 +28,7 @@ local ignored = {} local last_viewport, last_typos = nil, "" vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win) - if not spellcheck.enabled[win] or not win:style_define(42, "fore:red") then + if not spellcheck.enabled[win] or not win:style_define(42, spellcheck.typo_style) then return false end local viewport = win.viewport |