spelunker.vim
spelunker.vim copied to clipboard
Bad word pos detection in duplicated word appearance in one line
For lines that have the same word duplicatedly, it may suggest word-correct list for a different word.
'foo bar' hogefuga bar
# ^^^^^^^^
# `ZL` here, and it shows list for `bar`.
It checks word position by splitting the target line, though, it has not considered the length of cut part.
Also, it had targeted wrong word for the lines like below:
foo/bar/foobar/foobarbaz
~~~ ^^^^^^^^^
*
In this case, at the cursor position of *
,
it had targeted word foo
, that appears in the same line.
It had checked target word list by the word appearing order.
So, if the line had head-matching word of the pointing word (i.e. foo
, for foobarbaz
),
it had chosen the first appearing one.
To fix this, sorted the word list of the line in word length order.