aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * extract generic spellchecking functionality from the full viewport functionFlorian Fischer2020-08-261-15/+38
| | | | | | | | | | | | | | | | | | | | | | Add get_typos(range) to retrieve a string of misspelled word in a specific file range by calling the spellchecker's list command. It return nil or a string with each misspell followed by a newline. Introduce typo_iter(text, typos, ignored) to iterate over all not ignored typos and their positions in text. It returns an statefull iterator function closure. Which will return the next typo and ist start and finish in the text, starting by 1.
| * 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)
* | remove fortunatly ignored -a flag from most list commandsFlorian Fischer2020-08-281-7/+7
|/
* 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-252-2/+5
|
* 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
|
* Update ReadmeFlorian Fischer2019-01-281-9/+19
|
* 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 keymappings in readmeFlorian Fischer2018-02-221-2/+2
|
* update to api 0.4Florian Fischer2018-01-101-6/+14
|
* add aspell and hunspell as default spellcheckersFlorian Fischer2017-05-141-1/+9
|
* Mention spelllang option in readmeFlorian Fischer2017-05-101-0/+5
|
* add spelllang optionFlorian Fischer2017-05-051-0/+6
|
* Add MIT LicenseFlorian Fischer2017-04-262-0/+22
|
* document correct_under_cursorFlorian Fischer2017-04-261-0/+1
|
* fix code in ReadmeFlorian Fischer2017-04-261-1/+1
|
* fix code in ReadmeFlorian Fischer2017-04-261-5/+5
|
* 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-072-0/+80