diff options
author | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-25 11:08:22 +0100 |
---|---|---|
committer | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-25 11:08:22 +0100 |
commit | ada0b6ce8a1ed3f5f079cb6e12ff800d511fe65f (patch) | |
tree | 5a1a7bfa0773fb3ab3e69b20fcb670e3001c25aa | |
parent | 31d6d3ab854fa5191c49dda0db6ccfae7c4133fb (diff) | |
download | vis-spellcheck-ada0b6ce8a1ed3f5f079cb6e12ff800d511fe65f.tar.gz |
make typo_style_id configurable
-rw-r--r-- | spellcheck.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spellcheck.lua b/spellcheck.lua index e322d20..a96ba6a 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -25,6 +25,7 @@ else return nil end +spellcheck.typo_style_id = 42 spellcheck.typo_style = 'fore:red' spellcheck.check_full_viewport = {} spellcheck.disable_syntax_awareness = false @@ -153,7 +154,7 @@ local last_viewport, last_data, last_typos = nil, '', '' vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win) if not spellcheck.check_full_viewport[win] or - not win:style_define(42, spellcheck.typo_style) then + not win:style_define(spellcheck.typo_style_id, spellcheck.typo_style) then return end local viewport = win.viewport @@ -170,7 +171,7 @@ vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win) end for _, start, finish in typo_iter(viewport_text, typos, ignored) do - win:style(42, viewport.start + start - 1, viewport.start + finish) + win:style(spellcheck.typo_style_id, viewport.start + start - 1, viewport.start + finish) end last_viewport = viewport_text |