diff options
author | Bram Moolenaar <bram@vim.org> | 2014-08-29 12:08:43 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2014-08-29 12:08:43 +0200 |
commit | 5685f540c87fd9c0748024241bf02b058801d633 (patch) | |
tree | e5bb72aca5e5f5341d25aa5468634ca49eda8e5f | |
parent | 156d20ab2fb2817595b9c96751fab230d6814f0b (diff) | |
download | vim-5685f540c87fd9c0748024241bf02b058801d633.tar.gz |
Problem: When using conceal with linebreak some text is not displayed
correctly. (Gr?ner Gimpel)
Solution: Check for conceal mode when using linebreak. (Christian Brabandt)
-rw-r--r-- | src/screen.c | 11 | ||||
-rw-r--r-- | src/testdir/test_listlbr.in | 10 | ||||
-rw-r--r-- | src/testdir/test_listlbr.ok | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 30 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c index 4c134f0e..7a9311a4 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4514,6 +4514,11 @@ win_line(wp, lnum, startrow, endrow, nochange) int i; int saved_nextra = n_extra; +#ifdef FEAT_CONCEAL + if (is_concealing && vcol_off > 0) + /* there are characters to conceal */ + tab_len += vcol_off; +#endif /* if n_extra > 0, it gives the number of chars, to * use for a tab, else we need to calculate the width * for a tab */ @@ -4539,6 +4544,12 @@ win_line(wp, lnum, startrow, endrow, nochange) #endif } p_extra = p_extra_free; +#ifdef FEAT_CONCEAL + /* n_extra will be increased by FIX_FOX_BOGUSCOLS + * macro below, so need to adjust for that here */ + if (is_concealing && vcol_off > 0) + n_extra -= vcol_off; +#endif } #endif #ifdef FEAT_CONCEAL diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in index 0cce4c23..2f281265 100644 --- a/src/testdir/test_listlbr.in +++ b/src/testdir/test_listlbr.in @@ -46,6 +46,16 @@ STARTTEST :redraw! :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:let line="_S_\t bla" +:$put =line +:$ +:norm! zt +:let g:test ="Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)" +:set cpo&vim list linebreak conceallevel=2 concealcursor=nv listchars=tab:ab +:syn match ConcealVar contained /_/ conceal +:syn match All /.*/ contains=ConcealVar +:let line=ScreenChar(winwidth(0)) +:call DoRecordScreen() :%w! test.out :qa! ENDTEST diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok index be323d4d..9b8037f4 100644 --- a/src/testdir/test_listlbr.ok +++ b/src/testdir/test_listlbr.ok @@ -25,3 +25,10 @@ Test 4: set linebreak with tab and 1 line as long as screen: should break! +aaaaaaaaaaaaaaaaaa ~ ~ +_S_ bla + +Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated) +Sabbbbbb bla +~ +~ +~ diff --git a/src/version.c b/src/version.c index d047c9b8..31d1b34d 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 422, +/**/ 421, /**/ 420, |