diff src/gui.c @ 17342:54fcde87a9eb v8.1.1670

patch 8.1.1670: sign column not always properly aligned commit https://github.com/vim/vim/commit/0231f8312b11a259d9cb550f3318895f6b4d76be Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 12 19:22:22 2019 +0200 patch 8.1.1670: sign column not always properly aligned Problem: Sign column not always properly aligned. Solution: Use "col" only after it was calculated. (Yee Cheng Chin, closes #4649)
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Jul 2019 19:30:04 +0200
parents 16d5e91c5e5b
children df340014f9e4
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -2253,7 +2253,7 @@ gui_outstr_nowrap(
     int		col = gui.col;
 #ifdef FEAT_SIGN_ICONS
     int		draw_sign = FALSE;
-    int		signcol = col;
+    int		signcol;
     char_u	extra[18];
 # ifdef FEAT_NETBEANS_INTG
     int		multi_sign = FALSE;
@@ -2270,7 +2270,7 @@ gui_outstr_nowrap(
 # ifdef FEAT_NETBEANS_INTG
 	  || *s == MULTISIGN_BYTE
 # endif
-    )
+       )
     {
 # ifdef FEAT_NETBEANS_INTG
 	if (*s == MULTISIGN_BYTE)
@@ -2289,7 +2289,10 @@ gui_outstr_nowrap(
 	    --col;
 	len = (int)STRLEN(s);
 	if (len > 2)
-	    signcol = col + len - 3;	// Right align sign icon in the number column
+	    // right align sign icon in the number column
+	    signcol = col + len - 3;
+	else
+	    signcol = col;
 	draw_sign = TRUE;
 	highlight_mask = 0;
     }