mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.1896: "below" virtual text doesn't work with 'rightleft'
Problem: "below" virtual text doesn't work with 'rightleft'. Solution: Use column from right border with 'rightleft'. closes: #13071 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
committed by
Christian Brabandt
parent
4d00b835c4
commit
6b9c202549
@@ -2011,10 +2011,8 @@ win_line(
|
|||||||
|
|
||||||
if (wlv.n_extra == 0 ||
|
if (wlv.n_extra == 0 ||
|
||||||
(!wlv.extra_for_textprop
|
(!wlv.extra_for_textprop
|
||||||
#ifdef FEAT_PROP_POPUP
|
|
||||||
&& !(text_prop_type != NULL &&
|
&& !(text_prop_type != NULL &&
|
||||||
text_prop_flags & PT_FLAG_OVERRIDE)
|
text_prop_flags & PT_FLAG_OVERRIDE)
|
||||||
#endif
|
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
text_prop_attr = 0;
|
text_prop_attr = 0;
|
||||||
@@ -2134,7 +2132,7 @@ win_line(
|
|||||||
if (*ptr == NUL)
|
if (*ptr == NUL)
|
||||||
// don't combine char attr after EOL
|
// don't combine char attr after EOL
|
||||||
text_prop_flags &= ~PT_FLAG_COMBINE;
|
text_prop_flags &= ~PT_FLAG_COMBINE;
|
||||||
#ifdef FEAT_LINEBREAK
|
# ifdef FEAT_LINEBREAK
|
||||||
if (above || below || right || !wrap)
|
if (above || below || right || !wrap)
|
||||||
{
|
{
|
||||||
// no 'showbreak' before "below" text property
|
// no 'showbreak' before "below" text property
|
||||||
@@ -2142,7 +2140,7 @@ win_line(
|
|||||||
wlv.need_showbreak = FALSE;
|
wlv.need_showbreak = FALSE;
|
||||||
wlv.dont_use_showbreak = TRUE;
|
wlv.dont_use_showbreak = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
if ((right || above || below || !wrap
|
if ((right || above || below || !wrap
|
||||||
|| padding > 0) && wp->w_width > 2)
|
|| padding > 0) && wp->w_width > 2)
|
||||||
{
|
{
|
||||||
@@ -2155,6 +2153,11 @@ win_line(
|
|||||||
// exactly the same.
|
// exactly the same.
|
||||||
start_line = text_prop_position(wp, tp,
|
start_line = text_prop_position(wp, tp,
|
||||||
wlv.vcol,
|
wlv.vcol,
|
||||||
|
# ifdef FEAT_RIGHTLEFT
|
||||||
|
wp->w_p_rl
|
||||||
|
? wp->w_width - wlv.col - 1
|
||||||
|
:
|
||||||
|
# endif
|
||||||
wlv.col,
|
wlv.col,
|
||||||
&wlv.n_extra, &wlv.p_extra,
|
&wlv.n_extra, &wlv.p_extra,
|
||||||
&n_attr, &wlv.n_attr_skip,
|
&n_attr, &wlv.n_attr_skip,
|
||||||
|
6
src/testdir/dumps/Test_prop_below_rightleft_1.dump
Normal file
6
src/testdir/dumps/Test_prop_below_rightleft_1.dump
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
| +0&#ffffff0@50|e|d|c|b>a| +0#af5f00255&|1| @1
|
||||||
|
| +0#0000000&@50|5+0#e000e06&|4|3|2|1| +0#af5f00255&@3
|
||||||
|
| +0#4040ff13&@58|~
|
||||||
|
| @58|~
|
||||||
|
| @58|~
|
||||||
|
| +0#0000000&@41|1|,|1| @10|A|l@1|
|
@@ -3087,6 +3087,23 @@ func Test_prop_with_multibyte_below()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_prop_with_text_below_rightleft()
|
||||||
|
CheckRunVimInTerminal
|
||||||
|
CheckFeature rightleft
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
setlocal number rightleft
|
||||||
|
call setline(1, 'abcde')
|
||||||
|
call prop_type_add('theprop', #{highlight: 'Special'})
|
||||||
|
call prop_add(1, 0, #{type: 'theprop', text: '12345', text_align: 'below'})
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XscriptPropBelowRightleft', 'D')
|
||||||
|
let buf = RunVimInTerminal('-S XscriptPropBelowRightleft', #{rows: 6, cols: 60})
|
||||||
|
call VerifyScreenDump(buf, 'Test_prop_below_rightleft_1', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_prop_with_text_above_empty()
|
func Test_prop_with_text_above_empty()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1896,
|
||||||
/**/
|
/**/
|
||||||
1895,
|
1895,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user