Patch 8.2.3700
Problem: Text property highlighting continues over breakindent.
Solution: Stop before the end column. (closes #9242)
Files: src/drawline.c, src/testdir/test_textprop.vim,
src/testdir/dumps/Test_prop_linebreak.dump
*** ../vim-8.2.3699/src/drawline.c 2021-11-29 19:18:33.910686983 +0000
--- src/drawline.c 2021-11-29 21:11:19.168177835 +0000
***************
*** 265,270 ****
--- 265,273 ----
int c_extra = NUL; // extra chars, all the same
int c_final = NUL; // final char, mandatory if set
int extra_attr = 0; // attributes when n_extra != 0
+ #ifdef FEAT_LINEBREAK
+ int in_linebreak = FALSE; // n_extra set for showing
linebreak
+ #endif
static char_u *at_end_str = (char_u *)""; // used for p_extra when
// displaying eol at end-of-line
int lcs_eol_one = wp->w_lcs_chars.eol; // eol until it's
been used
***************
*** 1419,1425 ****
int pi;
int bcol = (int)(ptr - line);
! if (n_extra > 0)
--bcol; // still working on the previous char, e.g. Tab
// Check if any active property ends.
--- 1422,1432 ----
int pi;
int bcol = (int)(ptr - line);
! if (n_extra > 0
! # ifdef FEAT_LINEBREAK
! && !in_linebreak
! # endif
! )
--bcol; // still working on the previous char, e.g. Tab
// Check if any active property ends.
***************
*** 1437,1442 ****
--- 1444,1454 ----
* (text_props_active - (pi + 1)));
--text_props_active;
--pi;
+ # ifdef FEAT_LINEBREAK
+ // not exactly right but should work in most cases
+ if (in_linebreak && syntax_attr == text_prop_attr)
+ syntax_attr = 0;
+ # endif
}
}
***************
*** 1705,1710 ****
--- 1717,1726 ----
++p_extra;
}
--n_extra;
+ #ifdef FEAT_LINEBREAK
+ if (n_extra <= 0)
+ in_linebreak = FALSE;
+ #endif
}
else
{
***************
*** 2030,2035 ****
--- 2046,2053 ----
c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
c_final = NUL;
+ if (n_extra > 0)
+ in_linebreak = TRUE;
if (VIM_ISWHITE(c))
{
# ifdef FEAT_CONCEAL
*** ../vim-8.2.3699/src/testdir/test_textprop.vim 2021-11-23
11:46:12.409848336 +0000
--- src/testdir/test_textprop.vim 2021-11-29 21:08:51.032354252 +0000
***************
*** 1615,1620 ****
--- 1615,1638 ----
bwipe!
enddef
+ func Test_prop_in_linebreak()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set breakindent linebreak breakat+=]
+ call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
+ call prop_type_add('test', #{highlight: 'ErrorMsg'})
+ call prop_add(1, 51, #{length: 1, type: 'test'})
+ END
+ call writefile(lines, 'XscriptPropLinebreak')
+ let buf = RunVimInTerminal('-S XscriptPropLinebreak', #{rows: 10})
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_prop_linebreak', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptPropLinebreak')
+ endfunc
+
" Buffer number of 0 should be ignored, as if the parameter wasn't passed.
def Test_prop_bufnr_zero()
new
*** ../vim-8.2.3699/src/testdir/dumps/Test_prop_linebreak.dump 2021-11-29
21:12:10.812114279 +0000
--- src/testdir/dumps/Test_prop_linebreak.dump 2021-11-29 21:08:53.624351253
+0000
***************
*** 0 ****
--- 1,10 ----
+ >x+0&#ffffff0@49|]+0#ffffff16#e000002| +0#0000000#ffffff0@23
+ |x@69| @4
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|1|,|1| @10|A|l@1|
*** ../vim-8.2.3699/src/version.c 2021-11-29 20:39:06.682101619 +0000
--- src/version.c 2021-11-29 20:47:37.889603145 +0000
***************
*** 755,756 ****
--- 755,758 ----
{ /* Add new patch number below this line */
+ /**/
+ 3700,
/**/
--
./configure
Checking whether build environment is sane ...
build environment is grinning and holding a spatula. Guess not.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211129211322.70A721C4F5E%40moolenaar.net.