macedo / vim

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

wrong virtcol("']") if last yanked character is non-ASCII #277

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Assume you have a buffer with exactly two lines. The first line containing 
exactly one character, e.g. U+2502 (│), the second line containing exactly 
one character, e.g. U+0041 (a):

line 1: │
line 2: a

What steps will reproduce the problem?
1. Place the cursor at line 1, virtcol 1
2. Start visual mode and yank one character and echo the virtcol of the last 
yanked part, i.e. type:
vy:echo virtcol("']")
The answer will be 2, although line 1 has no second virt-column.

For the ASCII-character you get a different answer: Doing the same thing with 
line 2, virtcol 1
vy:echo virtcol("']")
will give as answer 1. 

What is the expected output? What do you see instead?
Expected output: in both cases "1", because there is only one virtual column in 
every line. Instead I get virtcol 2 in the first line.

What version of the product are you using? On what operating system?
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 18 2014 23:29:48)
Included patches: 1-207, 209-481
OS: Fedora 20

Original issue reported on code.google.com by Ludwi...@gmx.de on 30 Oct 2014 at 11:37