Re: VIM-7.2.394 multibyte related problem?
- SungHyun Nam wrote:
> Hello,This bug happens because the ':set listchars=precedes:...' character
> With the attached files (vimrc and mb.txt), if I open the mb.txt
> and just type A,
> gvim -u vimrc -U NONE --noplugin mb.txt
> Now, I should saw (X = cursor):
> But, I saw
> ....aaaa, X
> It occurs on 3 different versions of gvim,
> win32/cygwin-gtk2/linux-gtk2. I included cygwin-gtk2 version info
printed on the left of the line is interfering with the '<' character
also printed on the left of the line when a double-width char is
partially present on the left of the window.
Another consequence of this bug, is that columns
in different lines can be displayed misaligned.
1) Load misaligned.txt attached file (utf-8 file):
vim -u NONE misalign.txt
2) Type Ex command:
:set nu columns=80 tw=0 nowrap listchars=precedes:@ sidescroll=1
3) Scroll horizontally in command mode with zl and zh
4) Observe that while scrolling horizontally, vertical
alignment of columns is not preserved.
See screenshots before and after scrolling with zl:
Notice that not only line 4 is not aligned vertically with
other lines in second screenshot, but the '<' character
displayed at line 3 should not be there since no
double-width multi-byte char is truncated at line 3!
So given these lines in buffer...
after scrolling horizontally, Vim-7.2.411 currently displays:
I think that Vim should display this (vertically aligned):
Looking at the code, it's unclear to me how to implement it.
win_line() function is quite complicated. The '<' char and '@'
char (listchar=precedes:@) are printed in screen.c around those
3872 /* If a double-width char doesn't fit at the left side display
3873 * a '<' in the first column. */
3874 if (n_skip > 0 && mb_l > 1)
3876 n_extra = 1;
3877 c_extra = '<';
4327 * Handle the case where we are in column 0 but not on the first
4328 * character of the line and the user wants us to show us a
4329 * special character (via 'listchars' option "precedes:<char>".
4331 if (lcs_prec_todo != NUL
4332 && (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
4333 #ifdef FEAT_DIFF
4334 && filler_todo <= 0
4336 && draw_state > WL_NR
4337 && c != NUL)
4339 c = lcs_prec;
4340 lcs_prec_todo = NUL;
4341 #ifdef FEAT_MBYTE
4342 mb_c = c;
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.