Patch 8.1.1712
Problem: Signs in number column cause text to be misaligned.
Solution: Improve alignment. (Yasuhiro Matsumoto, closes #4694)
Files: src/screen.c, src/testdir/test_signs.vim
*** ../vim-8.1.1711/src/screen.c 2019-07-07 14:26:55.859493907 +0200
--- src/screen.c 2019-07-18 12:42:33.972862016 +0200
***************
*** 3120,3127 ****
{
if (nrcol)
{
! sprintf((char *)extra, "%*s ", number_width(wp),
! *pp_extra);
*pp_extra = extra;
}
*c_extrap = NUL;
--- 3120,3132 ----
{
if (nrcol)
{
! int n, width = number_width(wp) - 2;
!
! for (n = 0; n < width; n++)
! extra[n] = ' ';
! extra[n] = 0;
! STRCAT(extra, *pp_extra);
! STRCAT(extra, " ");
*pp_extra = extra;
}
*c_extrap = NUL;
*** ../vim-8.1.1711/src/testdir/test_signs.vim 2019-07-13 21:18:51.468469559
+0200
--- src/testdir/test_signs.vim 2019-07-18 12:38:52.674000072 +0200
***************
*** 1766,1771 ****
--- 1766,1772 ----
set number
set signcolumn=number
sign define sign1 text==>
+ sign define sign2 text=V
sign place 10 line=1 name=sign1
redraw!
call assert_equal("=> 01234", s:ScreenLine(1, 1, 8))
***************
*** 1846,1851 ****
--- 1847,1858 ----
redraw!
call assert_equal("=> 01234", s:ScreenLine(1, 1, 8))
call assert_equal(" 2 abcde", s:ScreenLine(2, 1, 8))
+ " Add sign with multi-byte text
+ set numberwidth=4
+ sign place 40 line=2 name=sign2
+ redraw!
+ call assert_equal(" => 01234", s:ScreenLine(1, 1, 9))
+ call assert_equal(" V abcde", s:ScreenLine(2, 1, 9))
sign unplace * group=*
sign undefine sign1
*** ../vim-8.1.1711/src/version.c 2019-07-17 22:55:30.767036831 +0200
--- src/version.c 2019-07-18 12:40:35.245472574 +0200
***************
*** 779,780 ****
--- 779,782 ----
{ /* Add new patch number below this line */
+ /**/
+ 1712,
/**/
--
A programmer's wife asks him: "Please run to the store and pick up a loaf of
bread. If they have eggs, get a dozen". The programmer comes home with 12
loafs of bread.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
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/201907181048.x6IAmbBH018123%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.