Tuesday, August 19, 2014

Peculiar spell-check replacement behavior (bug?)

Playing around with the most recent vimgolf challenge, I was
surprised by the following. To replicate the issue in a document with
multiple different misspelled words:

- :set spell


- On a misspelled word (in the vimgolf case, this is "Mosst") use

1z=

to select the first replacement. Good (it now reads "Most")

- use "]s" to jump to the next (different) misspelled word (in the
vimgolf case, this is "heirarchies")

- use "." to repeat the "1z=" action

Expected behavior: the period repeat executes the "z=" action using
the previous count (1) to choose the first replacement for the word
under the cursor (in this case, it should be "hierarchies")

Current (well, 7.3.547 on Debian Stable) behavior: the period repeat
replaces the word under the cursor with the replacement used in the
previous "1z=" (in this case, it changed "heirarchies" to "Most")

More peculiarly, if you use "2." to choose the 2nd replacement
choice, it swallowed the space after "heirarchies" but still replaced
it with "Most", and "3." swallowed the trailing space AND the
following word.

I found it surprising, but am not sure whether this is a bug (and if
so, to what degree) or just a mismatch between my expectations and
reality (tweaking documentation on "." to clarify what qualifies as a
"simple change" might help clear up my misunderstanding).

Thoughts from others here?

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: