aboutsummaryrefslogtreecommitdiff
path: root/spellcheck.lua
Commit message (Collapse)AuthorAgeFilesLines
* introduce new syntax aware spellchecking mechanismFlorian Fischer2020-08-251-9/+132
| | | | | | | | | | | | | | | | | | | | | | | | Fallback to the old mechanism if no lexer is active. Algorithm: 1. Wrap the active lexer's lex function and save it original value to restore it 2. Obtain the original token stream 3. Filter the tokens for visibility and if we want to spellcheck them (lexers.COMMENT and lexers.STRING by default) 4. Spellcheck the selected token. This is why this is unusably slow we shell out to our spellchecker for each token to check. 5. Split up the selected token into its correct and misspelled parts 6. Insert the correct parts unmodified and the misspelled ones as lexers.ERROR tokens into the token stream Drawbacks: 1. It is unusably slow for now 2. The problem to decide which tokens should be spellchecked still remains. A lexer using different token names than we expect will prevent our spellchecking TODO: 1. Introduce a way to disable syntax aware spellchecking and always use the old check full viewport approach 2. Speedup the syntax aware spellchecking (Maybe by splitting it into two iterations: First collect all toens to spellcheck and shell out once to spellcheck them all Second build up the token stream using the typo information we got)
* fix start index for string.findFlorian Fischer2020-08-251-1/+1
| | | | Lua indexing starts at 1 not 0.
* make the style of typo highlights configurableFlorian Fischer2020-08-251-1/+2
|
* toggle spellchecking on <F7> thanks to @leorosaFlorian Fischer2020-04-281-0/+13
|
* don't ignore the first typoFlorian Fischer2020-04-281-2/+0
| | | | The list commands used to retrieve all typos don't print a header line.
* make sure typos is always a stringFlorian Fischer2020-04-281-2/+2
| | | | | | vis:pipe apparently returns nil when the executed command does not write to stdout. fixes #1.
* don't delete word if correction is emptyFlorian Fischer2020-03-301-1/+1
|
* fix corrections containing whitespaceFlorian Fischer2020-01-171-1/+1
|
* make selection of spellchecker more usable with different shellsFlorian Fischer2019-11-061-4/+5
|
* use 42 instead of win.STYLE_INFO as style idFlorian Fischer2019-01-281-2/+2
| | | | Now the used style should not overlapp with a different feature
* spellcheck :)Florian Fischer2019-01-281-3/+3
|
* Redesign spellcheckingFlorian Fischer2019-01-281-67/+113
| | | | | | | | | Highlightning of misspelled words is accomplished by changing their style to win.STYLE_INFO before each draw (this changes also the color of vis:info messages). To improve the performance only the visible viewport is checked without getting corrections. Misspelled words can be ignored till the editor exits.
* update to api 0.4Florian Fischer2018-01-101-6/+14
|
* add aspell and hunspell as default spellcheckersFlorian Fischer2017-05-141-1/+9
|
* add spelllang optionFlorian Fischer2017-05-051-0/+6
|
* Add MIT LicenseFlorian Fischer2017-04-261-0/+3
|
* improve spellcheck and add new function to spellcheck word under cursorFlorian Fischer2017-04-091-8/+31
|
* generalize spellcheck to work on rangesFlorian Fischer2017-04-091-31/+31
|
* add Readme and pluginFlorian Fischer2017-04-071-0/+58