Patch 8.2.0281

9 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 19, 2020, 11:13:40 AM2/19/20
to vim...@googlegroups.com

Patch 8.2.0281
Problem: Two placed signs in the same line are not combined. E.g. in the
terminal debugger a breakpoint and the PC cannot be both be
displayed.
Solution: Combine the sign column and line highlight attributes.
Files: src/sign.c, src/testdir/test_signs.vim,
src/testdir/dumps/Test_sign_cursor_3.dump,
src/testdir/dumps/Test_sign_cursor_4.dump


*** ../vim-8.2.0280/src/sign.c 2020-01-09 21:01:32.552829739 +0100
--- src/sign.c 2020-02-19 16:53:56.923486193 +0100
***************
*** 514,519 ****
--- 514,543 ----
sattr->sat_texthl = syn_id2attr(sp->sn_text_hl);
if (sp->sn_line_hl > 0)
sattr->sat_linehl = syn_id2attr(sp->sn_line_hl);
+
+ // If there is another sign next with the same priority, may
+ // combine the text and the line highlighting.
+ if (sign->se_next != NULL
+ && sign->se_next->se_priority == sign->se_priority
+ && sign->se_next->se_lnum == sign->se_lnum)
+ {
+ sign_T *next_sp = find_sign_by_typenr(sign->se_next->se_typenr);
+
+ if (next_sp != NULL)
+ {
+ if (sattr->sat_icon == NULL && sattr->sat_text == NULL)
+ {
+ # ifdef FEAT_SIGN_ICONS
+ sattr->sat_icon = next_sp->sn_image;
+ # endif
+ sattr->sat_text = next_sp->sn_text;
+ }
+ if (sp->sn_text_hl <= 0 && next_sp->sn_text_hl > 0)
+ sattr->sat_texthl = syn_id2attr(next_sp->sn_text_hl);
+ if (sp->sn_line_hl <= 0 && next_sp->sn_line_hl > 0)
+ sattr->sat_linehl = syn_id2attr(next_sp->sn_line_hl);
+ }
+ }
return TRUE;
}
}
*** ../vim-8.2.0280/src/testdir/test_signs.vim 2020-01-09 21:01:32.548829753 +0100
--- src/testdir/test_signs.vim 2020-02-19 17:02:51.745501348 +0100
***************
*** 1742,1747 ****
--- 1742,1748 ----
call setline(1, [repeat('x', 75), 'mmmm', 'yyyy'])
call cursor(2,1)
sign define s1 texthl=Search text==>
+ sign define s2 linehl=Pmenu
redraw
sign place 10 line=2 name=s1
END
***************
*** 1753,1763 ****
call term_sendkeys(buf, ":sign define s1 text=-)\<CR>")
call VerifyScreenDump(buf, 'Test_sign_cursor_2', {})

" update cursor position calculation
call term_sendkeys(buf, "lh")
call term_sendkeys(buf, ":sign unplace 10\<CR>")
! call VerifyScreenDump(buf, 'Test_sign_cursor_3', {})
!

" clean up
call StopVimInTerminal(buf)
--- 1754,1768 ----
call term_sendkeys(buf, ":sign define s1 text=-)\<CR>")
call VerifyScreenDump(buf, 'Test_sign_cursor_2', {})

+ " Also place a line HL sign
+ call term_sendkeys(buf, ":sign place 11 line=2 name=s2\<CR>")
+ call VerifyScreenDump(buf, 'Test_sign_cursor_3', {})
+
" update cursor position calculation
call term_sendkeys(buf, "lh")
+ call term_sendkeys(buf, ":sign unplace 11\<CR>")
call term_sendkeys(buf, ":sign unplace 10\<CR>")
! call VerifyScreenDump(buf, 'Test_sign_cursor_4', {})

" clean up
call StopVimInTerminal(buf)
*** ../vim-8.2.0280/src/testdir/dumps/Test_sign_cursor_3.dump 2020-01-09 21:01:32.552829739 +0100
--- src/testdir/dumps/Test_sign_cursor_3.dump 2020-02-19 17:01:50.473765833 +0100
***************
*** 1,6 ****
! |x+0&#ffffff0@74
! >m@3| @70
! |y@3| @70
|~+0#4040ff13&| @73
! |~| @73
! |:+0#0000000&|s|i|g|n| |u|n|p|l|a|c|e| |1|0| @40|2|,|1| @10|A|l@1|
--- 1,6 ----
! | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
! | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
! |-+0&#ffff4012|)>m+0#0000001#ffd7ff255@3| @68
! | +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
|~+0#4040ff13&| @73
! |:+0#0000000&|s|i|g|n| |p|l|a|c|e| |1@1| |l|i|n|e|=|2| |n|a|m|e|=|s|2| @27|2|,|1| @10|A|l@1|
*** ../vim-8.2.0280/src/testdir/dumps/Test_sign_cursor_4.dump 2020-02-19 17:12:40.991125841 +0100
--- src/testdir/dumps/Test_sign_cursor_4.dump 2019-06-16 13:45:31.000000000 +0200
***************
*** 0 ****
--- 1,6 ----
+ |x+0&#ffffff0@74
+ >m@3| @70
+ |y@3| @70
+ |~+0#4040ff13&| @73
+ |~| @73
+ |:+0#0000000&|s|i|g|n| |u|n|p|l|a|c|e| |1|0| @40|2|,|1| @10|A|l@1|
*** ../vim-8.2.0280/src/version.c 2020-02-19 17:06:07.428684012 +0100
--- src/version.c 2020-02-19 17:12:28.031175913 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 281,
/**/

--
From "know your smileys":
<>:-) Bishop

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages