diff src/edit.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 3ca08bf99396
children a69d3595d773
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -1783,7 +1783,7 @@ edit_putchar(int c, int highlight)
 #ifdef FEAT_RIGHTLEFT
 	if (curwin->w_p_rl)
 	{
-	    pc_col += W_WIDTH(curwin) - 1 - curwin->w_wcol;
+	    pc_col += curwin->w_width - 1 - curwin->w_wcol;
 # ifdef FEAT_MBYTE
 	    if (has_mbyte)
 	    {
@@ -1865,7 +1865,7 @@ display_dollar(colnr_T col)
     }
 #endif
     curs_columns(FALSE);	    /* recompute w_wrow and w_wcol */
-    if (curwin->w_wcol < W_WIDTH(curwin))
+    if (curwin->w_wcol < curwin->w_width)
     {
 	edit_putchar('$', FALSE);
 	dollar_vcol = curwin->w_virtcol;
@@ -6820,7 +6820,7 @@ check_auto_format(
 /*
  * Find out textwidth to be used for formatting:
  *	if 'textwidth' option is set, use it
- *	else if 'wrapmargin' option is set, use W_WIDTH(curwin) - 'wrapmargin'
+ *	else if 'wrapmargin' option is set, use curwin->w_width - 'wrapmargin'
  *	if invalid value, use 0.
  *	Set default to window width (maximum 79) for "gq" operator.
  */
@@ -6835,7 +6835,7 @@ comp_textwidth(
     {
 	/* The width is the window width minus 'wrapmargin' minus all the
 	 * things that add to the margin. */
-	textwidth = W_WIDTH(curwin) - curbuf->b_p_wm;
+	textwidth = curwin->w_width - curbuf->b_p_wm;
 #ifdef FEAT_CMDWIN
 	if (cmdwin_type != 0)
 	    textwidth -= 1;
@@ -6854,7 +6854,7 @@ comp_textwidth(
 	textwidth = 0;
     if (ff && textwidth == 0)
     {
-	textwidth = W_WIDTH(curwin) - 1;
+	textwidth = curwin->w_width - 1;
 	if (textwidth > 79)
 	    textwidth = 79;
     }
@@ -9447,7 +9447,7 @@ ins_mousescroll(int dir)
 	    int val, step = 6;
 
 	    if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
-		step = W_WIDTH(curwin);
+		step = curwin->w_width;
 	    val = curwin->w_leftcol + (dir == MSCR_RIGHT ? -step : step);
 	    if (val < 0)
 		val = 0;