diff src/screen.c @ 17427:45c1dc353321 v8.1.1712

patch 8.1.1712: signs in number column cause text to be misaligned commit https://github.com/vim/vim/commit/d6bcff457799e491c3d27880858ec08e758e1849 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 18 12:48:16 2019 +0200 patch 8.1.1712: signs in number column cause text to be misaligned Problem: Signs in number column cause text to be misaligned. Solution: Improve alignment. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/4694)
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Jul 2019 13:00:06 +0200
parents a513b81d3689
children 967e2ee9b656
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -3120,8 +3120,13 @@ get_sign_display_info(
 		{
 		    if (nrcol)
 		    {
-			sprintf((char *)extra, "%*s ", number_width(wp),
-								*pp_extra);
+			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;