odeke-em / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Concealed text causes vim to wrap before window width #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Execute ":setlocal conceallevel=3 concealcursor=nvic |syn match Foo conceal 
'^....................'".
2. Make vim window narrow, say ~40 columns.
3. Type "The quick brown fox jumps over the lazy dog." twice.

What is the expected output? What do you see instead?
Vim should not wrap the line until the visible text actually reaches the edge 
of the window, but it wraps apparently 20 columns before the edge, as if the 
concealed characters still contribute to the effective length.

What version of the product are you using? On what operating system?
vim 7.4.430 on Ubuntu Linux 14.04

Original issue reported on code.google.com by dbarn...@google.com on 22 Sep 2014 at 6:41

GoogleCodeExporter commented 9 years ago
See screenshot. Note the cursor is at "1,41", which is wrapped onto the second 
line even though "dog." fits on the previous line.

Original comment by dbarn...@google.com on 22 Sep 2014 at 6:44

Attachments:

GoogleCodeExporter commented 9 years ago
This is how it is expected to work.  Wrapping works on the actual characters, 
no matter whether they are not visible or replaced by another character.
It would be possible to add an option to make it behave the other way, but it's 
going to be a lot of work (and slow).

Original comment by brammool...@gmail.com on 22 Sep 2014 at 7:47

GoogleCodeExporter commented 9 years ago
I would argue that wrapping is a purely visual thing, and so the most sensible 
thing to do would be to have it work on actually visible characters. Otherwise 
you will get very confusing wrapping behaviour.

Original comment by j...@opencloud.com on 13 Oct 2014 at 12:36

GoogleCodeExporter commented 9 years ago
Since in conceal mode the current cursor line has its concealed characters 
shown, wrapping based on visible characters would result in the lines being 
re-wrapped as you moved the cursor around the file. Even if this wasn't slow, 
it could create a very unpleasant "wobbling" visual effect.

Original comment by vince.ne...@gmail.com on 13 Oct 2014 at 6:52