| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| | |
consider the environment variable VIS_SPELLLANG as default
See merge request muhq/vis-spellcheck!12
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
If the variable VIS_SPELLLANG is not set the variable LANG is considered
next.
Passing the spellchecking language via the environment can be useful
when starting vis from different contexts.
My use case is different mail addresses in mutt.
On one address I mostly communicate in English and on another I
communicate in German. Passing the context specific language vis the
environment safes setting the spellchecking language for each email I
write.
|
| |\
| |
| |
| |
| | |
fix typo detection at file start
See merge request muhq/vis-spellcheck!11
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a file starts with a typo our pattern [%A]typo[%A] can not find it.
However if the same typo appears a second type in the text our pattern
happily finds the second occurence skipping the first and all typos
in between.
In the text
typo1
Correct text typo2 ...
typo1
our pattern will match the second occurence of 'typo1' skipping
'typo2'.
Since we update our search index 'typo2' will never be found and
vis-spellcheck will show the user an information prompt.
Fix this behaviour by adding a special case for the first typo which may
start the text.
|
| |\
| |
| |
| |
| | |
Sanitize LANG environment variable
See merge request muhq/vis-spellcheck!10
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
To me, this seems pretty useful for debugging purposes. It might
also be of general interest to the curious user.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is some discussion on the editorconfig side
about whether a 'spell_language' key could be added
(cf. https://github.com/editorconfig/editorconfig/issues/315,
https://github.com/seifferth/vis-editorconfig/pull/8). This key would
specify the natural language a file is written in and it would then
be up to the editor or plugin doing the spellchecking to respect that
setting and behave accordingly.
Since it is out of the scope of the vis-editorconfig plugin to
implement spellchecking, and since I would like the vis-editorconfig
plugin to work both with and without vis-spellcheck, I suggest
to use 'vis.win.file.spell_language' to store the document
language. With commit 0ee415c in the vis-editorconfig repo
(https://github.com/seifferth/vis-editorconfig), this value is already
set to the appropriate value. This commit adjusts the spellchecking
plugin to use the same global value. I did some testing that suggests
it should work.
There might still be some hickups if 'vis.win.file' does not exist.
This is a non-issue for editorconfig, since editorconfig only works
if 'vis.win.file.path' exists (which configuration is used depends
on the path). The Readme would also need some adjustment.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| | |
check if "LANG" environment variable exists before indexing it
|
| |/ |
|
| |
|
|
|
|
| |
* Remove unused variables
* Remove unused assginments
* Fix one actual bug (typo in variable name)
|
| | |
|
| |\
| |
| | |
Use single quotes around plugin path
|
| |/ |
|
| |
|
|
|
|
|
| |
The init.lua file is only a thin wrapper around a dofile call which loads
the actual plugin code in spellcheck.lua and returns the result.
Closes #5.
|
| |
|
|
|
|
|
| |
Because the lexer.lex wrapper function is a closure it saves the
state of the ignored word table in the closure.
Therefore to see the effect of ignoring words we must rebuild the wrapper
closure.
|
| |\
| |
| | |
Fix arrows in vis-menu by using vis:pipe()
|
| |/ |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| | |
If the typo itself contains magic pattern characters we can't reliable find
it in the text.
|
| | |
| |
| |
| |
| |
| | |
An iterator in lua stops if it returns nil.
This change will get a new typo from the unfiltered_iterator if
we encounter an empty one instead of returning nil.
|
| | |
| |
| |
| |
| | |
apparently in the typo list produced by aspell there is a blank line
which messes with our search for typos.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Before this change we assumed that when we are at the beginning of the
text (index == 1) and don't find the typo is must be the beginning of the
text but it can also be the end of the text.
We now also check the end if the beginning was not what we were lookig for.
|
| | | |
|
| | |
| |
| |
| |
| | |
This activates spellchecking for most "text focused" languages like
latex or markdown.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This happens because the "default" token gets emitted for each not matched
char resulting in lots of small "default" tokens.
This markdown:
> typu
will result in the token stream
{"default", 2, "default", 3, "default", 4, "default", 5}
and a typo stream with a single entry spanning all of the tokens
{{"typu", 1, 5}}.
Not checking if the typo is longer then the current token leads to an infinite
loop where the typo is always inserted in the new token stream without advancing
the token stream.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Our pattern [%A]<typo>[%A] does not match typos at the end or start of the text
because there is no leading / trailing non letter character.
So if we dind't find the typo with our normal pattern it must be either the start
or the end of the text. If not raise a warning that this must be a bug.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
of typos
This should make our spellchecking independent of the current window.
|
| | |
| |
| |
| |
| | |
If the end of a typo equals the end of a token we didn't advance the
typo stream entering an infinite loop.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When naivingly searching for the typo in our text we might find it
before its actual appearense in a correct word containing the typo
(e.g. "broken ok" would find the typo "ok" in the middle of the word "broken").
To prevent this we now only find a typo if its enclosed in non-letter
characters, this prevents typos from being found in regular words.
Typos starting with '"' for example are still found correctly.
|