Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The linebreak option doesn’t work well in Vim when s, S or c + <cr> are used

Tags:

vim

I’ve noticed a weird behaviour of (g)Vim: say I have a window with a line longer than its width and I’ve set wrap linebreak cursorline, if I hit s, S, cmotion or cc (but not i, a o or O) on another line and then hit , lines on this window are for some mysterious cause no longer wrapped at word boundaries (it looks as if I’ve set wrap nolinebreak). If I hit Esc and then j or k it returns to normal display.

This should obviously not occur. Is it a bug in Vim or something I did wrong? It occurs when invoking Vim tabula rasa (vim --noplugins -u NONE or gvim --noplugins -u NONE) as well. My machine is Arch Linux, and the Vim version I use is 7.4.537. I’ve tested it on another Arch Linux machine I have and it behaves the same, but when I sshed my DreamHost account, on which Vim 7.3.429 is installed, it behaves as it should.

Note: it doesn’t occur without cursorline on another line, so I guess it’s connected somehow, but I’m not really sure how. It occurs anyway if edit using s or cj on the same long line (than it affects only this line).

Can you confirm or disconfirm this erroneous behaviour occurs on your machine? How can one fix this?

(If it isn’t only me and it is a bug, I’ll send a bug report).

Thank you very much! ☺

like image 537
Júda Ronén Avatar asked Nov 09 '22 22:11

Júda Ronén


1 Answers

As per the discussion in the comments, this was indeed a bug, and was patched in 7.4 with patch #576.

like image 66
mgiuffrida Avatar answered Nov 15 '22 04:11

mgiuffrida