The linebreak option doesn't work well in Vim when using s, S or c + <cr>

Ive noticed the strange behavior of (g) Vim: let's say I have a window with a length exceeding its width, and Ive set wrap linebreak cursorline if I hit s , s , c motion or cc (but not i , a o or o ) ), and then press , the lines in this window are a mysterious reason that is no longer wrapped in word boundaries (it looks like this: if Ive set wrap nolinebreak ). If I hit Esc and then j or k , it will return to normal display.

This obviously should not be happening. Is it a bug in Vim or something that I did wrong? This happens when calling Vim tabula rasa ( vim --noplugins -u NONE or gvim --noplugins -u NONE ). My machine is Arch Linux, and the version of Vim that I use is 7.4.537. Ive tested it on another Arch Linux computer that I have, and it behaves the same, but when I ssh edited my DreamHost account on which Vim 7.3.429 is installed, it behaves as it should.

Note: this does not happen without a cursorline on another line, so I assume it is connected somehow, but Im not quite sure how to do this. This happens anyway if you are editing with s or c j on the same long line (which only affects this line).

Can you confirm or deny this erroneous behavior on your computer? How can this be fixed?

(If this is not only me, and this is a mistake, I send an error report).

Many thanks! ☺

+5
source share
1 answer

According to the discussion in the comments, this really was a mistake and was fixed in 7.4 with patch # 576 .

+1
source

Source: https://habr.com/ru/post/1208702/


All Articles