diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-05 21:39:30 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-05 21:39:30 +0100 |
commit | 3ec3b8e92da8299bcbfd851fa76fccf5403e4097 (patch) | |
tree | 83728edfb8f4190da1fd69c6c77e6ba2a6121b1e | |
parent | 50e75fe8d8c8ab262ab5b11d1498e5628044e07c (diff) |
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayedv9.0.0148
Problem: A "below" aligned text property gets 'showbreak' displayed.
Solution: Do not use 'showbreak' before or in virtual text. (issue #10851)
-rw-r--r-- | src/drawline.c | 15 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/drawline.c b/src/drawline.c index 47b8cdc94b..9e03b38a72 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -392,6 +392,7 @@ win_line( #ifdef FEAT_LINEBREAK int need_showbreak = FALSE; // overlong line, skipping first x // chars + int dont_use_showbreak = FALSE; // do not use 'showbreak' #endif #if defined(FEAT_SIGNS) || defined(FEAT_QUICKFIX) \ || defined(FEAT_SYN_HL) || defined(FEAT_DIFF) @@ -1567,7 +1568,15 @@ win_line( if (*ptr == NUL) // don't combine char attr after EOL text_prop_flags &= ~PT_FLAG_COMBINE; - +#ifdef FEAT_LINEBREAK + if (below || right) + { + // no 'showbreak' before "below" text property + // or after "right" text property + need_showbreak = FALSE; + dont_use_showbreak = TRUE; + } +#endif // Keep in sync with where // textprop_size_after_trunc() is called in // win_lbr_chartabsize(). @@ -3441,9 +3450,11 @@ win_line( n_extra = 0; lcs_prec_todo = wp->w_lcs_chars.prec; #ifdef FEAT_LINEBREAK + if (!dont_use_showbreak # ifdef FEAT_DIFF - if (filler_todo <= 0) + && filler_todo <= 0 # endif + ) need_showbreak = TRUE; #endif #ifdef FEAT_DIFF diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index 311de947fb..9bb37135ea 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2311,6 +2311,7 @@ func Test_props_with_text_after() CheckRunVimInTerminal let lines =<< trim END + set showbreak=+++ call setline(1, 'some text here and other text there') call prop_type_add('rightprop', #{highlight: 'ErrorMsg'}) call prop_type_add('afterprop', #{highlight: 'Search'}) diff --git a/src/version.c b/src/version.c index fcee2220c4..e32b8095d7 100644 --- a/src/version.c +++ b/src/version.c @@ -736,6 +736,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 148, +/**/ 147, /**/ 146, |