Closed tjharman closed 8 years ago
Instead what happens is I type ta"in and then for some reason (the message at the bottom says "Back at the original") the cursor jumps back to ta|"in then I press g
That's how spelling suggestions are designed to work. From :help compl-spelling
:
A word before or at the cursor is located and correctly spelled words are suggested to replace it. If there is a badly spelled word in the line, before or under the cursor, the cursor is moved to after it.
Ahhh right, of course. This is me misunderstanding vim's definition of a word. Sorry for the bogus bug report.
Sorry, that explains the first part of the bug report, but does that explain the second (the cursor jumping around a long way on backspace)?
When you start backspacing, autocompletion is triggered once and that causes spelling suggestions to be shown for wate
. Going on backspacing, nothing special happens as long as the pop-up menu stays open. When you reach the space, the pop-up menu closes because there are no matches before the cursor. When you backspace once more, you get…is
in front of the cursor and autocompletion fires again. Since all the methods before 'spel'
in your chain fail to return any result for is
, eventually the 'spel'
method is attempted. That is what causes the jump, as per the behaviour described in the manual. If there was another occurrence of is
in the text, keyword completion would take precedence and the cursor wouldn't jump.
My recommendation is not to use 'spel'
together with automatic completion. I wish there was an option in Vim to force spelling suggestions only for the current word, but unfortunately there isn't (as far as I know).
To see that it's Vim's default behaviour, turn off autocompletion and press <c-x>s
when the cursor is just after is
. You will see it jump to "Ta"ing
.
Thank you for the concise explanation. It is appreciated and again I apologise for wasting your time.
No worry. Feel free to open other issues if you need to provide more feedback!
@tjharman The current master has a new 'uspl'
completion method, which works like 'spel'
, but acts only on the word immediately before the cursor. That should resolve the issue you were having.
Fantastic! Thank you! I'll give it a try shortly.
For bug reports only, please provide the following details:
:help mucomplete-troubleshooting
.echo g:mucomplete#chains
:setl completeopt
:menu, preview'
.vimrc
, if any:If your problem has to do with specific completion methods, please provide the output of the relevant settings among the following:
If I enable spelling, with the options set above, I can't type: ta"ing
Instead what happens is I type ta"in and then for some reason (the message at the bottom says "Back at the original") the cursor jumps back to ta|"in then I press g. So I end up with tag"in
Also, if I have the following text:
If I try to backspace in insert mode from water, once water is deleted the cursor will jump back to "Ta"ing|
I guess this is actually some sort of vim behavior I am triggering?