| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
This is just for archiving the debugging code
|
| |
|
|
|
|
|
| |
This allows us to be independent of a vis.window and only use
the text passed to lexer.lex for our spellchecking.
This is helpfull when the active window is for example the command
prompt but the original source file still gets lexed.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
| |
Lua indexing starts at 1 not 0.
|
| | |
|
| | |
|
| |
|
|
| |
The list commands used to retrieve all typos don't print a header line.
|
| |
|
|
|
|
| |
vis:pipe apparently returns nil when the executed command does not
write to stdout.
fixes #1.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Now the used style should not overlapp with a different feature
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|