On Wed, Oct 24, 2018 at 1:57 PM John Little <[email protected]> wrote: > > I noticed a problem today when editing a paragraph that was wrapped to > several lines on screen. To reproduce, use a file with a line with normal > prose text that wraps to several screen lines, say x.txt, then > > vim -u NONE -c "set linebreak showbreak=....>" x.txt > > Move to the end of the long line, start a block selection with ctrl-V, press > y to yank it. The yanked text will be from an earlier part of the line, not > the text in the block selection. The offset increases with the amount of > space showing on the right of the text, space that without the 'linebreak' > option would not be blank. It doesn't happen with v for a character > selection. > > I bisected my .vimrc to find the settings triggering the problem, then used > git bisect to find the problem was introduced with v7.4.576: > > Date: Wed Jan 14 17:52:30 2015 +0100 > > updated for version 7.4.576 > Problem: Redrawing problem with 'relativenumber' and 'linebreak'. > Solution: Temporarily reset 'linebreak' and restore it in more places. > (Christian Brabandt) > > I could give a more detailed example, but Google groups might wrap it into a > confusing mess. > > I suppose that using a block selection for part of a line that is wrapped > with 'linebreak' is marginally useful so this problem is very minor. > > Regards, John Little
I confirm the problem, and in addition, when yanking a visual block extending over the common part (near, but not after, the end) of several successive long lines all wrapped with 'linebreak', the value that appears in the register after the yank is not only from an earlier part of the lines but of a different width than the highlight (which is displayed at the same visual abscissa, and thus not at the same distance from start-of-line, in all the lines over which it extends). If the selected block is shortly after a 'linebreak' wrap, the yanked text may even include some "virtual spaces" generated by 'linebreak' to wrap the line at a 'breakat' character. The difference in width is not explained by the difference in bytes for different UTF-8 characters: for instance in one file, after ":set lbr sbr=---\|" (not my usual setting) I see two consecutive file lines whose second screen lines start as: ---|href="#sryvatj">срыва́ть</a> ---|cou, un(e) risque-tout.</p> including the ---| 'showbreak' value. By block-selecting the /a together with the /p (a 2x2 block, all in ASCII) then yanking, I get atj">срыва́т^Jrisque-tout (which is rectangular in terms of characters, not bytes; but much longer) into the register. The excess length corresponds approximately AFAICT to the sum amount of virtual whitespace added by 'linebreak' at the end of both previous screen lines. (That file is online as part of my "Russian-French dictionary" project; the lines in question are lines 3131-3132 of http://users.skynet.be/antoine.mechelynck/slovarj/ru-fr.18.html as displayed in a full-screen gvim with encoding=utf-8 lines=68 columns=174 guifont=Bitstream Vera Sans Mono 8 linebreak showbreak=---| ). Try it, it is easier to see than to explain. Best regards, Tony. -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
