Minor bug: :helpgrep lands the cursor at wrong locations (to the left of where it ought to) where preceded by accented characters on the same line.

Seen in:
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 31 2010 15:08:58)
Included patches: 1-411
Extra patches: Extra float functions (Bill McCarthy)
Compiled by [email protected]
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
[...]

Reproducible: Always

Steps to reproduce:

1. Install the French help for Vim from http://www.vim.org/translations.php (it can be installed in $VIM/vimfiles without removing the English help in $VIMRUNTIME/doc). Note: the .tar.bz2 creates the doc/ subdirectory, so you should unpack it into some directory in 'runtimepath', not into its doc subdirectory.

2. Start Vim, and make sure that 'encoding' is UTF-8

3. (Optional)
        :map   <F2>    :cnext<CR>
        :map   <S-F2>  :cprev<CR>

4. Run :helpgrep (I used ":helpgrep iconv" without the quotes).

5. Look at successive matches in context (with the maps from step 3, hit F2 repeatedly).

Expected results:
The cursor always lands on the i of iconv

Actual results:
On lines which include accented characters before the first occurrence of iconv, the cursor lands to the left of where it ought to, by as many character cells as there are accented Latin letters before the match. This is of course more noticeable in the French *.frx helpfiles than in the English *.txt, because of the higher frequency of accented letters in the French language.

Additional info:
- I suspect that this is due to the fact that accented letters in the range 0xA0 to 0xFF use one byte each in the Latin1 file on disk, but two bytes each in memory after conversion to UTF-8. - I don't know if the error is in :helpgrep itself (when creating the quickfix list) or in quickfix (when interpreting the quickfix list to show the match in context). - The virtcol <=> byte difference is correctly taken into account for hard tabs.


Best regards,
Tony.
--
No man is an island, but some of us are long peninsulas.

--
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

To unsubscribe, reply using "remove me" as the subject.

Raspunde prin e-mail lui