diff src/misc2.c @ 12515:972ea22c946f v8.0.1136

patch 8.0.1136: W_WIDTH() is always the same commit https://github.com/vim/vim/commit/0263146b5dbbb6c120ce2e7720256503b864425d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 22 15:20:32 2017 +0200 patch 8.0.1136: W_WIDTH() is always the same Problem: W_WIDTH() is always the same. Solution: Expand the macro.
author Christian Brabandt <cb@256bit.org>
date Fri, 22 Sep 2017 15:30:06 +0200
parents 68d7bc045dbe
children 4e846c9d61a8
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -165,7 +165,7 @@ coladvance2(
     else
     {
 #ifdef FEAT_VIRTUALEDIT
-	int width = W_WIDTH(curwin) - win_col_off(curwin);
+	int width = curwin->w_width - win_col_off(curwin);
 
 	if (finetune
 		&& curwin->w_p_wrap
@@ -310,7 +310,7 @@ coladvance2(
 	    int b = (int)wcol - (int)col;
 
 	    /* The difference between wcol and col is used to set coladd. */
-	    if (b > 0 && b < (MAXCOL - 2 * W_WIDTH(curwin)))
+	    if (b > 0 && b < (MAXCOL - 2 * curwin->w_width))
 		pos->coladd = b;
 
 	    col += b;
@@ -662,7 +662,7 @@ leftcol_changed(void)
     int		retval = FALSE;
 
     changed_cline_bef_curs();
-    lastcol = curwin->w_leftcol + W_WIDTH(curwin) - curwin_col_off() - 1;
+    lastcol = curwin->w_leftcol + curwin->w_width - curwin_col_off() - 1;
     validate_virtcol();
 
     /*