Hi Ben!
On Mo, 16 Feb 2015, Ben Fritz wrote:
> On Monday, February 16, 2015 at 11:30:05 AM UTC-6, Ben Fritz wrote:
> > On Friday, February 13, 2015 at 4:03:48 PM UTC-6, Christian Brabandt wrote:
> > >
> > > Finally, I could debug this. Here is the patch, including a test.
> > >
> >
> > I confirm this seems to fix both issues (too much text hidden, and
> > fillchars drawing in the wrong color), in both the test file and in the
> > actual file I saw it in to begin with.
>
> Oops! It looks like something is wrong now, when using multibyte characters
> for the tab in listchars:
>
> gvim -N -u NONE -i NONE
> :set enc=utf-8
> :filetype on
> :syntax on
> :setl ft=c
> :set list listchars=tab:▕—
> :hi SpecialKey guifg=red
> :set linebreak
>
> Load the attached test.c file and note the red text within the comment.
> Toggle off 'linebreak' and the red text gets replaced by the normal blue
> comment text.
Good catch. Here is an updated patch, that fixes that problem and also
includes more tests. (I had problems with test88 before, so I enhanced
it to check for linebreak mode as well).
Best,
Christian
--
Das Rechte erkennen und nicht tun, ist Mangel an Mut.
-- Konfuzius (551-479 v. Chr.)
--
--
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.
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -4571,7 +4571,7 @@ win_line(wp, lnum, startrow, endrow, noc
int saved_nextra = n_extra;
#ifdef FEAT_CONCEAL
- if ((is_concealing || boguscols > 0) && vcol_off > 0)
+ if (vcol_off > 0)
/* there are characters to conceal */
tab_len += vcol_off;
/* boguscols before FIX_FOR_BOGUSCOLS macro from above
@@ -4609,25 +4609,28 @@ win_line(wp, lnum, startrow, endrow, noc
#ifdef FEAT_CONCEAL
/* n_extra will be increased by FIX_FOX_BOGUSCOLS
* macro below, so need to adjust for that here */
- if ((is_concealing || boguscols > 0) && vcol_off > 0)
+ if (vcol_off > 0)
n_extra -= vcol_off;
#endif
}
#endif
#ifdef FEAT_CONCEAL
- /* Tab alignment should be identical regardless of
- * 'conceallevel' value. So tab compensates of all
- * previous concealed characters, and thus resets vcol_off
- * and boguscols accumulated so far in the line. Note that
- * the tab can be longer than 'tabstop' when there
- * are concealed characters. */
- FIX_FOR_BOGUSCOLS;
- /* Make sure, the highlighting for the tab char will be
- * correctly set further below (effectively reverts the
- * FIX_FOR_BOGSUCOLS macro */
- if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list
+ {
+ int vc_saved = vcol_off;
+ /* Tab alignment should be identical regardless of
+ * 'conceallevel' value. So tab compensates of all
+ * previous concealed characters, and thus resets vcol_off
+ * and boguscols accumulated so far in the line. Note that
+ * the tab can be longer than 'tabstop' when there
+ * are concealed characters. */
+ FIX_FOR_BOGUSCOLS;
+ /* Make sure, the highlighting for the tab char will be
+ * correctly set further below (effectively reverts the
+ * FIX_FOR_BOGSUCOLS macro */
+ if (n_extra == tab_len + vc_saved && wp->w_p_list
&& lcs_tab1)
- tab_len += n_extra - tab_len;
+ tab_len += vc_saved;
+ }
#endif
#ifdef FEAT_MBYTE
mb_utf8 = FALSE; /* don't draw as UTF-8 */
diff --git a/src/testdir/test88.in b/src/testdir/test88.in
--- a/src/testdir/test88.in
+++ b/src/testdir/test88.in
@@ -71,6 +71,17 @@ GGk
:set lbr
:normal $
GGk
+:set list listchars=tab:>-
+:normal 0
+GGk
+:normal W
+GGk
+:normal W
+GGk
+:normal W
+GGk
+:normal $
+GGk
:" Display result.
:call append('$', 'end:')
:call append('$', positions)
diff --git a/src/testdir/test88.ok b/src/testdir/test88.ok
--- a/src/testdir/test88.ok
+++ b/src/testdir/test88.ok
@@ -22,3 +22,8 @@ 9:17
9:25
9:26
9:26
+9:1
+9:9
+9:17
+9:25
+9:26
diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -56,6 +56,41 @@ STARTTEST
:redraw!
:let line=ScreenChar(winwidth(0),7)
:call DoRecordScreen()
+:let g:test ="Test 5: set linebreak list listchars and concealing part2"
+:let c_defines=['bbeeeeee ; some text']
+:call append('$', c_defines)
+:$
+:norm! zt
+:set nowrap ts=2 list linebreak listchars=tab:>- cole=2 concealcursor=n
+:syn clear
+:syn match meaning /;\s*\zs.*/
+:syn match hasword /^\x\{8}/ contains=word
+:syn match word /\<\x\{8}\>/ contains=beginword,endword contained
+:syn match beginword /\<\x\x/ contained conceal
+:syn match endword /\x\{6}\>/ contained
+:hi meaning guibg=blue
+:hi beginword guibg=green
+:hi endword guibg=red
+:redraw!
+:let line=ScreenChar(winwidth(0),1)
+:call DoRecordScreen()
+:let g:test ="Test 6: Screenattributes for comment"
+:$put =g:test
+:call append('$', ' /* and some more */')
+:exe "set ft=c ts=7 linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
+:syntax on
+:hi SpecialKey term=underline ctermfg=red guifg=red
+:let attr=[]
+:nnoremap <expr> GG ":let attr += ['".screenattr(screenrow(),screencol())."']\n"
+:$
+:norm! zt0
+GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl
+:call append('$', ['ScreenAttributes for test6:'])
+:if attr[0] != attr[1] && attr[1] != attr[3] && attr[3] != attr[5]
+: call append('$', "Attribut 0 and 1 and 3 and 5 are different!")
+:else
+: call append('$', "Not all attributes are different")
+:endif
:%w! test.out
:qa!
ENDTEST
diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok
--- a/src/testdir/test_listlbr_utf8.ok
+++ b/src/testdir/test_listlbr_utf8.ok
@@ -36,3 +36,11 @@ Test 4: set linebreak list listchars and
#define >_FILE>--------->--->---1
#define >_CONSOLE>---------->---2
#define >_FILE_AND_CONSOLE>---------3
+bbeeeeee ; some text
+
+Test 5: set linebreak list listchars and concealing part2
+eeeeee>--->-;>some text
+Test 6: Screenattributes for comment
+ /* and some more */
+ScreenAttributes for test6:
+Attribut 0 and 1 and 3 and 5 are different!