spelunker.vim icon indicating copy to clipboard operation
spelunker.vim copied to clipboard

Bad word pos detection in duplicated word appearance in one line

Open KSR-Yasuda opened this issue 1 year ago • 1 comments

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.

KSR-Yasuda avatar Jul 12 '23 03:07 KSR-Yasuda

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.

KSR-Yasuda avatar Jul 18 '23 01:07 KSR-Yasuda