]> granicus.if.org Git - vim/commitdiff
patch 8.0.1136: W_WIDTH() is always the same v8.0.1136
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Sep 2017 13:20:32 +0000 (15:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Sep 2017 13:20:32 +0000 (15:20 +0200)
Problem:    W_WIDTH() is always the same.
Solution:   Expand the macro.

26 files changed:
src/charset.c
src/edit.c
src/evalfunc.c
src/ex_cmds.c
src/ex_docmd.c
src/getchar.c
src/gui.c
src/gui_beval.c
src/gui_mac.c
src/if_lua.c
src/if_mzsch.c
src/if_py_both.h
src/if_ruby.c
src/misc1.c
src/misc2.c
src/move.c
src/normal.c
src/popupmnu.c
src/quickfix.c
src/screen.c
src/search.c
src/structs.h
src/ui.c
src/version.c
src/vim.h
src/window.c

index 4f79c90aac6ad3d550f0a04523619198b7081fef..4516816fe4bac7ae903f486ebcdd8fa8bada9c70 100644 (file)
@@ -1100,7 +1100,7 @@ win_lbr_chartabsize(
         */
        numberextra = win_col_off(wp);
        col2 = col;
-       colmax = (colnr_T)(W_WIDTH(wp) - numberextra - col_adj);
+       colmax = (colnr_T)(wp->w_width - numberextra - col_adj);
        if (col >= colmax)
        {
            colmax += col_adj;
@@ -1151,10 +1151,10 @@ win_lbr_chartabsize(
 
        numberextra = numberwidth;
        col += numberextra + mb_added;
-       if (col >= (colnr_T)W_WIDTH(wp))
+       if (col >= (colnr_T)wp->w_width)
        {
-           col -= W_WIDTH(wp);
-           numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
+           col -= wp->w_width;
+           numberextra = wp->w_width - (numberextra - win_col_off2(wp));
            if (col >= numberextra && numberextra > 0)
                col %= numberextra;
            if (*p_sbr != NUL)
@@ -1170,18 +1170,18 @@ win_lbr_chartabsize(
 
            numberwidth -= win_col_off2(wp);
        }
-       if (col == 0 || col + size + sbrlen > (colnr_T)W_WIDTH(wp))
+       if (col == 0 || col + size + sbrlen > (colnr_T)wp->w_width)
        {
            added = 0;
            if (*p_sbr != NUL)
            {
-               if (size + sbrlen + numberwidth > (colnr_T)W_WIDTH(wp))
+               if (size + sbrlen + numberwidth > (colnr_T)wp->w_width)
                {
                    /* calculate effective window width */
-                   int width = (colnr_T)W_WIDTH(wp) - sbrlen - numberwidth;
-                   int prev_width = col ? ((colnr_T)W_WIDTH(wp) - (sbrlen + col)) : 0;
+                   int width = (colnr_T)wp->w_width - sbrlen - numberwidth;
+                   int prev_width = col ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0;
                    if (width == 0)
-                       width = (colnr_T)W_WIDTH(wp);
+                       width = (colnr_T)wp->w_width;
                    added += ((size - prev_width) / width) * vim_strsize(p_sbr);
                    if ((size - prev_width) % width)
                        /* wrapped, add another length of 'sbr' */
@@ -1248,7 +1248,7 @@ in_win_border(win_T *wp, colnr_T vcol)
 
     if (wp->w_width == 0)      /* there is no border */
        return FALSE;
-    width1 = W_WIDTH(wp) - win_col_off(wp);
+    width1 = wp->w_width - win_col_off(wp);
     if ((int)vcol < width1 - 1)
        return FALSE;
     if ((int)vcol == width1 - 1)
index 8486e34aaf09f67a2a254cd55c31b5caa0cdb6df..14201a2ec3e36db56dff7ac0788007beb642ed67 100644 (file)
@@ -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;
index 6c2a73e8001961a2f304ee3bb334d5b5c7cec8b6..7b019a53d74eda838ab80ea1d6440e09167d4f26 100644 (file)
@@ -13239,7 +13239,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
 
        check_cursor();
        win_new_height(curwin, curwin->w_height);
-       win_new_width(curwin, W_WIDTH(curwin));
+       win_new_width(curwin, curwin->w_width);
        changed_window_setting();
 
        if (curwin->w_topline <= 0)
index 143ea55e4294dc620f86d0b82fe1056ce9add861..b4351b23dc35ca855979d5b96f526fccd592fb89 100644 (file)
@@ -177,7 +177,7 @@ ex_align(exarg_T *eap)
        if (width <= 0)
            width = curbuf->b_p_tw;
        if (width == 0 && curbuf->b_p_wm > 0)
-           width = W_WIDTH(curwin) - curbuf->b_p_wm;
+           width = curwin->w_width - curbuf->b_p_wm;
        if (width <= 0)
            width = 80;
     }
index adf42799e4942062953f9dd49afd0fe79de77e72..29435c2ea8bee03c06927ee4fdfd6eab1da1b2d9 100644 (file)
@@ -8486,7 +8486,7 @@ ex_resize(exarg_T *eap)
     if (cmdmod.split & WSP_VERT)
     {
        if (*eap->arg == '-' || *eap->arg == '+')
-           n += W_WIDTH(curwin);
+           n += curwin->w_width;
        else if (n == 0 && eap->arg[0] == NUL)  /* default is very wide */
            n = 9999;
        win_setwidth_win((int)n, wp);
index 179b2f3e0e010f98dfd64be6cd9f5d53c616de6f..ef42d9c8cc1468cf714c8120c537b20fc8620368 100644 (file)
@@ -2666,8 +2666,8 @@ vgetorpeek(int advance)
                                        ++col;
                                }
                                curwin->w_wrow = curwin->w_cline_row
-                                          + curwin->w_wcol / W_WIDTH(curwin);
-                               curwin->w_wcol %= W_WIDTH(curwin);
+                                          + curwin->w_wcol / curwin->w_width;
+                               curwin->w_wcol %= curwin->w_width;
                                curwin->w_wcol += curwin_col_off();
 #ifdef FEAT_MBYTE
                                col = 0;        /* no correction needed */
@@ -2684,7 +2684,7 @@ vgetorpeek(int advance)
                        else if (curwin->w_p_wrap && curwin->w_wrow)
                        {
                            --curwin->w_wrow;
-                           curwin->w_wcol = W_WIDTH(curwin) - 1;
+                           curwin->w_wcol = curwin->w_width - 1;
 #ifdef FEAT_MBYTE
                            col = curwin->w_cursor.col - 1;
 #endif
index 4f9c63f669d6af6bc87149652a2db68bd3e258b2..a17c57112deb2d94387a5d8b4463fffad0a5a15e 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -4564,14 +4564,14 @@ gui_update_horiz_scrollbar(int force)
        return;
     }
 
-    size = W_WIDTH(curwin);
+    size = curwin->w_width;
     if (curwin->w_p_wrap)
     {
        value = 0;
 #ifdef SCROLL_PAST_END
        max = 0;
 #else
-       max = W_WIDTH(curwin) - 1;
+       max = curwin->w_width - 1;
 #endif
     }
     else
@@ -4591,7 +4591,7 @@ gui_update_horiz_scrollbar(int force)
 #endif
 
 #ifndef SCROLL_PAST_END
-       max += W_WIDTH(curwin) - 1;
+       max += curwin->w_width - 1;
 #endif
        /* The line number isn't scrolled, thus there is less space when
         * 'number' or 'relativenumber' is set (also for 'foldcolumn'). */
index 2dbce7e595e5eb71cb375467c0857b12b841172a..1c01ecc84ac9a4db38568a0c6244d9a6b884a93d 100644 (file)
@@ -338,7 +338,7 @@ get_beval_info(
     row = Y_2_ROW(beval->y);
     col = X_2_COL(beval->x);
     wp = mouse_find_win(&row, &col);
-    if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
+    if (wp != NULL && row < wp->w_height && col < wp->w_width)
     {
        /* Found a window and the cursor is in the text.  Now find the line
         * number. */
index 8803487dea50a8d0b1ef8c955802f3661d94f4ce..bbb0857a0cdefa4b4e93ff3d7d73366a6b6c2421 100644 (file)
@@ -1612,7 +1612,7 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode)
     else                       /* Bottom scrollbar */
     {
        sb_info = sb;
-       page = W_WIDTH(curwin) - 5;
+       page = curwin->w_width - 5;
     }
 
     switch (partCode)
index ef827ca589de64df35ee103697ffcceba913cfc6..bc7029389e3760f63ac3e10f668b842de90e366b 100644 (file)
@@ -1179,7 +1179,7 @@ luaV_window_index(lua_State *L)
     else if (strncmp(s, "col", 3) == 0)
        lua_pushinteger(L, w->w_cursor.col + 1);
     else if (strncmp(s, "width", 5) == 0)
-       lua_pushinteger(L, W_WIDTH(w));
+       lua_pushinteger(L, w->w_width);
     else if (strncmp(s, "height", 6) == 0)
        lua_pushinteger(L, w->w_height);
     /* methods */
index 657782273163bc3fd98408a00884a2303664d74b..c9c5969483a29423f8468249e4aa94767632bc34 100644 (file)
@@ -2063,7 +2063,7 @@ get_window_width(void *data, int argc, Scheme_Object **argv)
     Vim_Prim       *prim = (Vim_Prim *)data;
     vim_mz_window   *win = get_window_arg(prim->name, 0, argc, argv);
 
-    return scheme_make_integer(W_WIDTH(win->win));
+    return scheme_make_integer(win->win->w_width);
 }
 
 /* (set-win-width {width} [window]) */
index ea8752d98abb6c6939bffd5cf06f0bc4cd7d0198..e717646d0544e84131c732655c6c3c56844fc8e7 100644 (file)
@@ -3875,7 +3875,7 @@ WindowAttr(WindowObject *self, char *name)
     else if (strcmp(name, "row") == 0)
        return PyLong_FromLong((long)(self->win->w_winrow));
     else if (strcmp(name, "width") == 0)
-       return PyLong_FromLong((long)(W_WIDTH(self->win)));
+       return PyLong_FromLong((long)(self->win->w_width));
     else if (strcmp(name, "col") == 0)
        return PyLong_FromLong((long)(self->win->w_wincol));
     else if (strcmp(name, "vars") == 0)
index c1a6840f4d96958fae139059febaab767261535c..9474e7c8a60f7e84592d7e28d9f8e7e7de5f25a4 100644 (file)
@@ -1470,7 +1470,7 @@ static VALUE window_set_height(VALUE self, VALUE height)
 
 static VALUE window_width(VALUE self UNUSED)
 {
-    return INT2NUM(W_WIDTH(get_win(self)));
+    return INT2NUM(get_win(self->w_width));
 }
 
 static VALUE window_set_width(VALUE self UNUSED, VALUE width)
index 369b716ad5625d2014322fde691fcdc3457f669b..f7789ff79402fdee9f42afb84a1c90777063e8e7 100644 (file)
@@ -495,7 +495,7 @@ get_breakindent_win(
     static varnumber_T prev_tick = 0;   /* changedtick of cached value */
     int                    bri = 0;
     /* window width minus window margin space, i.e. what rests for text */
-    const int      eff_wwidth = W_WIDTH(wp)
+    const int      eff_wwidth = wp->w_width
                            - ((wp->w_p_nu || wp->w_p_rnu)
                                && (vim_strchr(p_cpo, CPO_NUMCOL) == NULL)
                                                ? number_width(wp) + 1 : 0);
@@ -2026,7 +2026,7 @@ plines_win_nofold(win_T *wp, linenr_T lnum)
     /*
      * Add column offset for 'number', 'relativenumber' and 'foldcolumn'.
      */
-    width = W_WIDTH(wp) - win_col_off(wp);
+    width = wp->w_width - win_col_off(wp);
     if (width <= 0)
        return 32000;
     if (col <= width)
@@ -2083,7 +2083,7 @@ plines_win_col(win_T *wp, linenr_T lnum, long column)
     /*
      * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc.
      */
-    width = W_WIDTH(wp) - win_col_off(wp);
+    width = wp->w_width - win_col_off(wp);
     if (width <= 0)
        return 9999;
 
index d956e3a6b8bfcc22171e155e9b41cc1c0a58dd00..fac44c737a30c43f9eece04f24c6f16fa9e204c1 100644 (file)
@@ -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();
 
     /*
index c520f5fd51806de3c23af514badbc621b652c5dc..4e5618d7b797973f6ae06abe9122462f32520192 100644 (file)
@@ -855,14 +855,14 @@ validate_cursor_col(void)
        col = curwin->w_virtcol;
        off = curwin_col_off();
        col += off;
-       width = W_WIDTH(curwin) - off + curwin_col_off2();
+       width = curwin->w_width - off + curwin_col_off2();
 
        /* long line wrapping, adjust curwin->w_wrow */
        if (curwin->w_p_wrap
-               && col >= (colnr_T)W_WIDTH(curwin)
+               && col >= (colnr_T)curwin->w_width
                && width > 0)
            /* use same formula as what is used in curs_columns() */
-           col -= ((col - W_WIDTH(curwin)) / width + 1) * width;
+           col -= ((col - curwin->w_width) / width + 1) * width;
        if (col > (int)curwin->w_leftcol)
            col -= curwin->w_leftcol;
        else
@@ -975,11 +975,11 @@ curs_columns(
      */
     curwin->w_wrow = curwin->w_cline_row;
 
-    textwidth = W_WIDTH(curwin) - extra;
+    textwidth = curwin->w_width - extra;
     if (textwidth <= 0)
     {
        /* No room for text, put cursor in last char of window. */
-       curwin->w_wcol = W_WIDTH(curwin) - 1;
+       curwin->w_wcol = curwin->w_width - 1;
        curwin->w_wrow = curwin->w_height - 1;
     }
     else if (curwin->w_p_wrap && curwin->w_width != 0)
@@ -987,10 +987,10 @@ curs_columns(
        width = textwidth + curwin_col_off2();
 
        /* long line wrapping, adjust curwin->w_wrow */
-       if (curwin->w_wcol >= W_WIDTH(curwin))
+       if (curwin->w_wcol >= curwin->w_width)
        {
            /* this same formula is used in validate_cursor_col() */
-           n = (curwin->w_wcol - W_WIDTH(curwin)) / width + 1;
+           n = (curwin->w_wcol - curwin->w_width) / width + 1;
            curwin->w_wcol -= n * width;
            curwin->w_wrow += n;
 
@@ -1021,7 +1021,7 @@ curs_columns(
         * extra
         */
        off_left = (int)startcol - (int)curwin->w_leftcol - p_siso;
-       off_right = (int)endcol - (int)(curwin->w_leftcol + W_WIDTH(curwin)
+       off_right = (int)endcol - (int)(curwin->w_leftcol + curwin->w_width
                                                                - p_siso) + 1;
        if (off_left < 0 || off_right > 0)
        {
@@ -1249,7 +1249,7 @@ scrolldown(
        validate_virtcol();
        validate_cheight();
        wrow += curwin->w_cline_height - 1 -
-           curwin->w_virtcol / W_WIDTH(curwin);
+           curwin->w_virtcol / curwin->w_width;
     }
     while (wrow >= curwin->w_height && curwin->w_cursor.lnum > 1)
     {
@@ -1454,7 +1454,7 @@ scrolldown_clamp(void)
        validate_cheight();
        validate_virtcol();
        end_row += curwin->w_cline_height - 1 -
-           curwin->w_virtcol / W_WIDTH(curwin);
+           curwin->w_virtcol / curwin->w_width;
     }
     if (end_row < curwin->w_height - p_so)
     {
@@ -1512,7 +1512,7 @@ scrollup_clamp(void)
     if (curwin->w_p_wrap && curwin->w_width != 0)
     {
        validate_virtcol();
-       start_row -= curwin->w_virtcol / W_WIDTH(curwin);
+       start_row -= curwin->w_virtcol / curwin->w_width;
     }
     if (start_row >= p_so)
     {
index 6fffbcbc17781844884c9329ebc7ddb775f87373..d2d1a292156a5e9bff29a4891035d657a5e92940 100644 (file)
@@ -4448,8 +4448,8 @@ nv_screengo(oparg_T *oap, int dir, long dist)
 
     col_off1 = curwin_col_off();
     col_off2 = col_off1 - curwin_col_off2();
-    width1 = W_WIDTH(curwin) - col_off1;
-    width2 = W_WIDTH(curwin) - col_off2;
+    width1 = curwin->w_width - col_off1;
+    width2 = curwin->w_width - col_off2;
     if (width2 == 0)
        width2 = 1; /* avoid divide by zero */
 
@@ -4634,7 +4634,7 @@ nv_mousescroll(cmdarg_T *cap)
            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 + (cap->arg == MSCR_RIGHT ? -step : +step);
            if (val < 0)
                val = 0;
@@ -4886,7 +4886,7 @@ dozet:
 
                /* "zH" - scroll screen right half-page */
     case 'H':
-               cap->count1 *= W_WIDTH(curwin) / 2;
+               cap->count1 *= curwin->w_width / 2;
                /* FALLTHROUGH */
 
                /* "zh" - scroll screen to the right */
@@ -4903,7 +4903,7 @@ dozet:
                break;
 
                /* "zL" - scroll screen left half-page */
-    case 'L':  cap->count1 *= W_WIDTH(curwin) / 2;
+    case 'L':  cap->count1 *= curwin->w_width / 2;
                /* FALLTHROUGH */
 
                /* "zl" - scroll screen to the left */
@@ -4947,7 +4947,7 @@ dozet:
                    else
 #endif
                    getvcol(curwin, &curwin->w_cursor, NULL, NULL, &col);
-                   n = W_WIDTH(curwin) - curwin_col_off();
+                   n = curwin->w_width - curwin_col_off();
                    if ((long)col + p_siso < n)
                        col = 0;
                    else
@@ -8073,7 +8073,7 @@ nv_g_cmd(cmdarg_T *cap)
        oap->inclusive = FALSE;
        if (curwin->w_p_wrap && curwin->w_width != 0)
        {
-           int         width1 = W_WIDTH(curwin) - curwin_col_off();
+           int         width1 = curwin->w_width - curwin_col_off();
            int         width2 = width1 + curwin_col_off2();
 
            validate_virtcol();
@@ -8087,7 +8087,7 @@ nv_g_cmd(cmdarg_T *cap)
         * 'relativenumber' is on and lines are wrapping the middle can be more
         * to the left. */
        if (cap->nchar == 'm')
-           i += (W_WIDTH(curwin) - curwin_col_off()
+           i += (curwin->w_width - curwin_col_off()
                    + ((curwin->w_p_wrap && i > 0)
                        ? curwin_col_off2() : 0)) / 2;
        coladvance((colnr_T)i);
@@ -8139,7 +8139,7 @@ nv_g_cmd(cmdarg_T *cap)
                curwin->w_curswant = MAXCOL;    /* so we stay at the end */
                if (cap->count1 == 1)
                {
-                   int         width1 = W_WIDTH(curwin) - col_off;
+                   int         width1 = curwin->w_width - col_off;
                    int         width2 = width1 + curwin_col_off2();
 
                    validate_virtcol();
@@ -8171,7 +8171,7 @@ nv_g_cmd(cmdarg_T *cap)
            }
            else
            {
-               i = curwin->w_leftcol + W_WIDTH(curwin) - col_off - 1;
+               i = curwin->w_leftcol + curwin->w_width - col_off - 1;
                coladvance((colnr_T)i);
 
                /* Make sure we stick in this column. */
@@ -9565,7 +9565,7 @@ get_op_vcol(
     colnr_T        start, end;
 
     if (VIsual_mode != Ctrl_V
-           || (!initial && oap->end.col < W_WIDTH(curwin)))
+           || (!initial && oap->end.col < curwin->w_width))
        return;
 
     oap->block_mode = TRUE;
index 0467c39845ce5d7c23424a386a275c8a5b7e772a..c2b3e736191ce6e181bc2a0a467e4d4cc2b368ed 100644 (file)
@@ -190,7 +190,7 @@ redo:
     /* Calculate column */
 #ifdef FEAT_RIGHTLEFT
     if (curwin->w_p_rl)
-       col = curwin->w_wincol + W_WIDTH(curwin) - curwin->w_wcol - 1;
+       col = curwin->w_wincol + curwin->w_width - curwin->w_wcol - 1;
     else
 #endif
        col = curwin->w_wincol + curwin->w_wcol;
@@ -312,7 +312,7 @@ pum_redraw(void)
 #ifdef FEAT_RIGHTLEFT
        if (curwin->w_p_rl)
        {
-           if (pum_col < curwin->w_wincol + W_WIDTH(curwin) - 1)
+           if (pum_col < curwin->w_wincol + curwin->w_width - 1)
                screen_putchar(' ', row, pum_col + 1, attr);
        }
        else
index 4625db98441e865b85152cd688b116721d770592..850fa7b6c8cd9164cf427a5c6180c97298af82f0 100644 (file)
@@ -3148,7 +3148,7 @@ ex_copen(exarg_T *eap)
        {
            if (cmdmod.split & WSP_VERT)
            {
-               if (height != W_WIDTH(win))
+               if (height != win->w_width)
                    win_setwidth(height);
            }
            else if (height != win->w_height)
index 260471acef1bcfcf9e8aa7c0480e4ed7e382ed96..13b6a063236d984ffc439b238005f3fc71bc00d1 100644 (file)
@@ -2353,8 +2353,8 @@ win_draw_end(
        if (n > 0)
        {
            /* draw the fold column at the right */
-           if (n > W_WIDTH(wp))
-               n = W_WIDTH(wp);
+           if (n > wp->w_width)
+               n = wp->w_width;
            screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
                    W_ENDCOL(wp) - n, (int)W_ENDCOL(wp),
                    ' ', ' ', HL_ATTR(HLF_FC));
@@ -2366,8 +2366,8 @@ win_draw_end(
            int nn = n + 2;
 
            /* draw the sign column left of the fold column */
-           if (nn > W_WIDTH(wp))
-               nn = W_WIDTH(wp);
+           if (nn > wp->w_width)
+               nn = wp->w_width;
            screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
                    W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n,
                    ' ', ' ', HL_ATTR(HLF_SC));
@@ -2402,8 +2402,8 @@ win_draw_end(
            int     nn = n + fdc;
 
            /* draw the fold column at the left */
-           if (nn > W_WIDTH(wp))
-               nn = W_WIDTH(wp);
+           if (nn > wp->w_width)
+               nn = wp->w_width;
            screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
                    wp->w_wincol + n, (int)wp->w_wincol + nn,
                    ' ', ' ', HL_ATTR(HLF_FC));
@@ -2416,8 +2416,8 @@ win_draw_end(
            int     nn = n + 2;
 
            /* draw the sign column after the fold column */
-           if (nn > W_WIDTH(wp))
-               nn = W_WIDTH(wp);
+           if (nn > wp->w_width)
+               nn = wp->w_width;
            screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
                    wp->w_wincol + n, (int)wp->w_wincol + nn,
                    ' ', ' ', HL_ATTR(HLF_SC));
@@ -2482,7 +2482,7 @@ text_to_screenline(win_T *wp, char_u *text, int col)
        {
            cells = (*mb_ptr2cells)(p);
            c_len = (*mb_ptr2len)(p);
-           if (col + cells > W_WIDTH(wp)
+           if (col + cells > wp->w_width
 # ifdef FEAT_RIGHTLEFT
                    - (wp->w_p_rl ? col : 0)
 # endif
@@ -2566,8 +2566,8 @@ text_to_screenline(win_T *wp, char_u *text, int col)
     {
        int len = (int)STRLEN(text);
 
-       if (len > W_WIDTH(wp) - col)
-           len = W_WIDTH(wp) - col;
+       if (len > wp->w_width - col)
+           len = wp->w_width - col;
        if (len > 0)
        {
 #ifdef FEAT_RIGHTLEFT
@@ -2593,7 +2593,7 @@ compute_foldcolumn(win_T *wp, int col)
 {
     int fdc = wp->w_p_fdc;
     int wmw = wp == curwin && p_wmw == 0 ? 1 : p_wmw;
-    int wwidth = W_WIDTH(wp);
+    int wwidth = wp->w_width;
 
     if (fdc > wwidth - (col + wmw))
        fdc = wwidth - (col + wmw);
@@ -2662,11 +2662,11 @@ fold_line(
        {
            int         i;
 
-           copy_text_attr(off + W_WIDTH(wp) - fdc - col, buf, fdc,
+           copy_text_attr(off + wp->w_width - fdc - col, buf, fdc,
                                                             HL_ATTR(HLF_FC));
            /* reverse the fold column */
            for (i = 0; i < fdc; ++i)
-               ScreenLines[off + W_WIDTH(wp) - i - 1 - col] = buf[i];
+               ScreenLines[off + wp->w_width - i - 1 - col] = buf[i];
        }
        else
 #endif
@@ -2677,7 +2677,7 @@ fold_line(
 #ifdef FEAT_RIGHTLEFT
 # define RL_MEMSET(p, v, l)  if (wp->w_p_rl) \
                                for (ri = 0; ri < l; ++ri) \
-                                  ScreenAttrs[off + (W_WIDTH(wp) - (p) - (l)) + ri] = v; \
+                                  ScreenAttrs[off + (wp->w_width - (p) - (l)) + ri] = v; \
                             else \
                                for (ri = 0; ri < l; ++ri) \
                                   ScreenAttrs[off + (p) + ri] = v
@@ -2688,13 +2688,13 @@ fold_line(
 
     /* Set all attributes of the 'number' or 'relativenumber' column and the
      * text */
-    RL_MEMSET(col, HL_ATTR(HLF_FL), W_WIDTH(wp) - col);
+    RL_MEMSET(col, HL_ATTR(HLF_FL), wp->w_width - col);
 
 #ifdef FEAT_SIGNS
     /* If signs are being displayed, add two spaces. */
     if (signcolumn_on(wp))
     {
-       len = W_WIDTH(wp) - col;
+       len = wp->w_width - col;
        if (len > 0)
        {
            if (len > 2)
@@ -2702,7 +2702,7 @@ fold_line(
 # ifdef FEAT_RIGHTLEFT
            if (wp->w_p_rl)
                /* the line number isn't reversed */
-               copy_text_attr(off + W_WIDTH(wp) - len - col,
+               copy_text_attr(off + wp->w_width - len - col,
                                        (char_u *)"  ", len, HL_ATTR(HLF_FL));
            else
 # endif
@@ -2717,7 +2717,7 @@ fold_line(
      */
     if (wp->w_p_nu || wp->w_p_rnu)
     {
-       len = W_WIDTH(wp) - col;
+       len = wp->w_width - col;
        if (len > 0)
        {
            int     w = number_width(wp);
@@ -2747,7 +2747,7 @@ fold_line(
 #ifdef FEAT_RIGHTLEFT
            if (wp->w_p_rl)
                /* the line number isn't reversed */
-               copy_text_attr(off + W_WIDTH(wp) - len - col, buf, len,
+               copy_text_attr(off + wp->w_width - len - col, buf, len,
                                                             HL_ATTR(HLF_FL));
            else
 #endif
@@ -2775,7 +2775,7 @@ fold_line(
     if (wp->w_p_rl)
        col -= txtcol;
 #endif
-    while (col < W_WIDTH(wp)
+    while (col < wp->w_width
 #ifdef FEAT_RIGHTLEFT
                    - (wp->w_p_rl ? txtcol : 0)
 #endif
@@ -2837,14 +2837,14 @@ fold_line(
            if (VIsual_mode == Ctrl_V)
            {
                /* Visual block mode: highlight the chars part of the block */
-               if (wp->w_old_cursor_fcol + txtcol < (colnr_T)W_WIDTH(wp))
+               if (wp->w_old_cursor_fcol + txtcol < (colnr_T)wp->w_width)
                {
                    if (wp->w_old_cursor_lcol != MAXCOL
                             && wp->w_old_cursor_lcol + txtcol
-                                                      < (colnr_T)W_WIDTH(wp))
+                                                      < (colnr_T)wp->w_width)
                        len = wp->w_old_cursor_lcol;
                    else
-                       len = W_WIDTH(wp) - txtcol;
+                       len = wp->w_width - txtcol;
                    RL_MEMSET(wp->w_old_cursor_fcol + txtcol, HL_ATTR(HLF_V),
                                            len - (int)wp->w_old_cursor_fcol);
                }
@@ -2852,7 +2852,7 @@ fold_line(
            else
            {
                /* Set all attributes of the text */
-               RL_MEMSET(txtcol, HL_ATTR(HLF_V), W_WIDTH(wp) - txtcol);
+               RL_MEMSET(txtcol, HL_ATTR(HLF_V), wp->w_width - txtcol);
            }
        }
     }
@@ -2872,7 +2872,7 @@ fold_line(
                txtcol -= wp->w_skipcol;
            else
                txtcol -= wp->w_leftcol;
-           if (txtcol >= 0 && txtcol < W_WIDTH(wp))
+           if (txtcol >= 0 && txtcol < wp->w_width)
                ScreenAttrs[off + txtcol] = hl_combine_attr(
                                    ScreenAttrs[off + txtcol], HL_ATTR(HLF_MC));
            txtcol = old_txtcol;
@@ -2888,14 +2888,14 @@ fold_line(
            txtcol -= wp->w_skipcol;
        else
            txtcol -= wp->w_leftcol;
-       if (txtcol >= 0 && txtcol < W_WIDTH(wp))
+       if (txtcol >= 0 && txtcol < wp->w_width)
            ScreenAttrs[off + txtcol] = hl_combine_attr(
                                 ScreenAttrs[off + txtcol], HL_ATTR(HLF_CUC));
     }
 #endif
 
-    screen_line(row + W_WINROW(wp), wp->w_wincol, (int)W_WIDTH(wp),
-                                                    (int)W_WIDTH(wp), FALSE);
+    screen_line(row + W_WINROW(wp), wp->w_wincol, (int)wp->w_width,
+                                                    (int)wp->w_width, FALSE);
 
     /*
      * Update w_cline_height and w_cline_folded if the cursor line was
@@ -3724,7 +3724,7 @@ win_line(
        /* Rightleft window: process the text in the normal direction, but put
         * it in current_ScreenLine[] from right to left.  Start at the
         * rightmost column of the window. */
-       col = W_WIDTH(wp) - 1;
+       col = wp->w_width - 1;
        off += col;
     }
 #endif
@@ -3963,7 +3963,7 @@ win_line(
                        n_extra = col + 1;
                    else
 #  endif
-                       n_extra = W_WIDTH(wp) - col;
+                       n_extra = wp->w_width - col;
                    char_attr = HL_ATTR(HLF_DED);
                }
 # endif
@@ -4016,7 +4016,7 @@ win_line(
 #endif
                )
        {
-           screen_line(screen_row, wp->w_wincol, col, -(int)W_WIDTH(wp),
+           screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
                                                    HAS_RIGHTLEFT(wp->w_p_rl));
            /* Pretend we have finished updating the window.  Except when
             * 'cursorcolumn' is set. */
@@ -4285,7 +4285,7 @@ win_line(
 # ifdef FEAT_RIGHTLEFT
                            wp->w_p_rl ? (col <= 0) :
 # endif
-                                   (col >= W_WIDTH(wp) - 1))
+                                   (col >= wp->w_width - 1))
                            && (*mb_char2cells)(mb_c) == 2)
                    {
                        c = '>';
@@ -4486,7 +4486,7 @@ win_line(
 # ifdef FEAT_RIGHTLEFT
                            wp->w_p_rl ? (col <= 0) :
 # endif
-                               (col >= W_WIDTH(wp) - 1))
+                               (col >= wp->w_width - 1))
                        && (*mb_char2cells)(mb_c) == 2)
                {
                    c = '>';
@@ -4703,7 +4703,7 @@ win_line(
                    /* TODO: is passing p for start of the line OK? */
                    n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
                                                                    NULL) - 1;
-                   if (c == TAB && n_extra + col > W_WIDTH(wp))
+                   if (c == TAB && n_extra + col > wp->w_width)
                        n_extra = (int)wp->w_buffer->b_p_ts
                                       - vcol % (int)wp->w_buffer->b_p_ts - 1;
 
@@ -4920,7 +4920,7 @@ win_line(
 # ifdef FEAT_RIGHTLEFT
                                    wp->w_p_rl ? (col >= 0) :
 # endif
-                                   (col < W_WIDTH(wp)))
+                                   (col < wp->w_width))
                                && !(noinvcur
                                    && lnum == wp->w_cursor.lnum
                                    && (colnr_T)vcol == wp->w_virtcol)))
@@ -5031,7 +5031,7 @@ win_line(
 # ifdef FEAT_RIGHTLEFT
                            wp->w_p_rl ? (col >= 0) :
 # endif
-                           (col < W_WIDTH(wp))))
+                           (col < wp->w_width)))
                {
                    c = ' ';
                    --ptr;          /* put it back at the NUL */
@@ -5054,7 +5054,7 @@ win_line(
 # ifdef FEAT_CONCEAL
                                - boguscols
 # endif
-                                           < W_WIDTH(wp))))
+                                           < wp->w_width)))
                {
                    /* Highlight until the right side of the window */
                    c = ' ';
@@ -5175,7 +5175,7 @@ win_line(
        {
 #  ifdef FEAT_RIGHTLEFT
            if (wp->w_p_rl)
-               wp->w_wcol = W_WIDTH(wp) - col + boguscols - 1;
+               wp->w_wcol = wp->w_width - col + boguscols - 1;
            else
 #  endif
                wp->w_wcol = col - boguscols;
@@ -5338,7 +5338,7 @@ win_line(
                else
 #endif
                {
-                   if (col >= W_WIDTH(wp))
+                   if (col >= wp->w_width)
                        n = -1;
                }
                if (n != 0)
@@ -5442,7 +5442,7 @@ win_line(
            if (((wp->w_p_cuc
                      && (int)wp->w_virtcol >= VCOL_HLC - eol_hl_off
                      && (int)wp->w_virtcol <
-                                       W_WIDTH(wp) * (row - startrow + 1) + v
+                                       wp->w_width * (row - startrow + 1) + v
                      && lnum != wp->w_cursor.lnum)
                    || draw_color_col)
 # ifdef FEAT_RIGHTLEFT
@@ -5461,7 +5461,7 @@ win_line(
                        if (rightmost_vcol < color_cols[i])
                            rightmost_vcol = color_cols[i];
 
-               while (col < W_WIDTH(wp))
+               while (col < wp->w_width)
                {
                    ScreenLines[off] = ' ';
 #ifdef FEAT_MBYTE
@@ -5489,7 +5489,7 @@ win_line(
 #endif
 
            screen_line(screen_row, wp->w_wincol, col,
-                                 (int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
+                                 (int)wp->w_width, HAS_RIGHTLEFT(wp->w_p_rl));
            row++;
 
            /*
@@ -5519,7 +5519,7 @@ win_line(
 #ifdef FEAT_RIGHTLEFT
                    wp->w_p_rl ? col == 0 :
 #endif
-                   col == W_WIDTH(wp) - 1)
+                   col == wp->w_width - 1)
                && (*ptr != NUL
                    || (wp->w_p_list && lcs_eol_one > 0)
                    || (n_extra && (c_extra != NUL || *p_extra != NUL))))
@@ -5784,7 +5784,7 @@ win_line(
 #ifdef FEAT_RIGHTLEFT
            wp->w_p_rl ? (col < 0) :
 #endif
-                                   (col >= W_WIDTH(wp)))
+                                   (col >= wp->w_width))
                && (*ptr != NUL
 #ifdef FEAT_DIFF
                    || filler_todo > 0
@@ -5795,11 +5795,11 @@ win_line(
        {
 #ifdef FEAT_CONCEAL
            screen_line(screen_row, wp->w_wincol, col - boguscols,
-                                 (int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
+                                 (int)wp->w_width, HAS_RIGHTLEFT(wp->w_p_rl));
            boguscols = 0;
 #else
            screen_line(screen_row, wp->w_wincol, col,
-                                 (int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
+                                 (int)wp->w_width, HAS_RIGHTLEFT(wp->w_p_rl));
 #endif
            ++row;
            ++screen_row;
@@ -5836,7 +5836,7 @@ win_line(
 #ifdef FEAT_DIFF
                     && filler_todo <= 0
 #endif
-                    && W_WIDTH(wp) == Columns)
+                    && wp->w_width == Columns)
            {
                /* Remember that the line wraps, used for modeless copy. */
                LineWraps[screen_row - 1] = TRUE;
@@ -5873,7 +5873,7 @@ win_line(
                     * then output the same character again to let the
                     * terminal know about the wrap.  If the terminal doesn't
                     * auto-wrap, we overwrite the character. */
-                   if (screen_cur_col != W_WIDTH(wp))
+                   if (screen_cur_col != wp->w_width)
                        screen_char(LineOffset[screen_row - 1]
                                                      + (unsigned)Columns - 1,
                                          screen_row - 1, (int)(Columns - 1));
@@ -5899,7 +5899,7 @@ win_line(
 #ifdef FEAT_RIGHTLEFT
            if (wp->w_p_rl)
            {
-               col = W_WIDTH(wp) - 1;  /* col is not used if breaking! */
+               col = wp->w_width - 1;  /* col is not used if breaking! */
                off += col;
            }
 #endif
@@ -6890,9 +6890,9 @@ win_redr_status(win_T *wp)
            len += (int)STRLEN(p + len);
        }
 
-       this_ru_col = ru_col - (Columns - W_WIDTH(wp));
-       if (this_ru_col < (W_WIDTH(wp) + 1) / 2)
-           this_ru_col = (W_WIDTH(wp) + 1) / 2;
+       this_ru_col = ru_col - (Columns - wp->w_width);
+       if (this_ru_col < (wp->w_width + 1) / 2)
+           this_ru_col = (wp->w_width + 1) / 2;
        if (this_ru_col <= 1)
        {
            p = (char_u *)"<";          /* No room for file name! */
@@ -7123,7 +7123,7 @@ win_redr_custom(
     {
        row = W_WINROW(wp) + wp->w_height;
        fillchar = fillchar_status(&attr, wp);
-       maxwidth = W_WIDTH(wp);
+       maxwidth = wp->w_width;
 
        if (draw_ruler)
        {
@@ -7139,10 +7139,10 @@ win_redr_custom(
                if (*stl++ != '(')
                    stl = p_ruf;
            }
-           col = ru_col - (Columns - W_WIDTH(wp));
-           if (col < (W_WIDTH(wp) + 1) / 2)
-               col = (W_WIDTH(wp) + 1) / 2;
-           maxwidth = W_WIDTH(wp) - col;
+           col = ru_col - (Columns - wp->w_width);
+           if (col < (wp->w_width + 1) / 2)
+               col = (wp->w_width + 1) / 2;
+           maxwidth = wp->w_width - col;
            if (!wp->w_status_height)
            {
                row = Rows - 1;
@@ -9422,7 +9422,7 @@ setcursor(void)
 #ifdef FEAT_RIGHTLEFT
                /* With 'rightleft' set and the cursor on a double-wide
                 * character, position it on the leftmost column. */
-               curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
+               curwin->w_p_rl ? ((int)curwin->w_width - curwin->w_wcol - (
 # ifdef FEAT_MBYTE
                        (has_mbyte
                           && (*mb_ptr2cells)(ml_get_cursor()) == 2
@@ -9628,7 +9628,7 @@ win_do_lines(
      * a character in the lower right corner of the scroll region may cause a
      * scroll-up .
      */
-    if (scroll_region || W_WIDTH(wp) != Columns)
+    if (scroll_region || wp->w_width != Columns)
     {
        if (scroll_region && (wp->w_width == Columns || *T_CSV != NUL))
            scroll_region_set(wp, row);
@@ -10729,21 +10729,21 @@ redraw_win_toolbar(win_T *wp)
 
     /* TODO: use fewer spaces if there is not enough room */
     for (menu = wp->w_winbar->children;
-                         menu != NULL && col < W_WIDTH(wp); menu = menu->next)
+                         menu != NULL && col < wp->w_width; menu = menu->next)
     {
        space_to_screenline(off + col, fill_attr);
-       if (++col >= W_WIDTH(wp))
+       if (++col >= wp->w_width)
            break;
        if (col > 1)
        {
            space_to_screenline(off + col, fill_attr);
-           if (++col >= W_WIDTH(wp))
+           if (++col >= wp->w_width)
                break;
        }
 
        wp->w_winbar_items[item_idx].wb_startcol = col;
        space_to_screenline(off + col, button_attr);
-       if (++col >= W_WIDTH(wp))
+       if (++col >= wp->w_width)
            break;
 
        next_col = text_to_screenline(wp, menu->name, col);
@@ -10756,20 +10756,20 @@ redraw_win_toolbar(win_T *wp)
        wp->w_winbar_items[item_idx].wb_menu = menu;
        ++item_idx;
 
-       if (col >= W_WIDTH(wp))
+       if (col >= wp->w_width)
            break;
        space_to_screenline(off + col, button_attr);
        ++col;
     }
-    while (col < W_WIDTH(wp))
+    while (col < wp->w_width)
     {
        space_to_screenline(off + col, fill_attr);
        ++col;
     }
     wp->w_winbar_items[item_idx].wb_menu = NULL; /* end marker */
 
-    screen_line(wp->w_winrow, wp->w_wincol, (int)W_WIDTH(wp),
-                                                    (int)W_WIDTH(wp), FALSE);
+    screen_line(wp->w_winrow, wp->w_wincol, (int)wp->w_width,
+                                                    (int)wp->w_width, FALSE);
 }
 #endif
 /*
@@ -10901,7 +10901,7 @@ win_redr_ruler(win_T *wp, int always)
            row = W_WINROW(wp) + wp->w_height;
            fillchar = fillchar_status(&attr, wp);
            off = wp->w_wincol;
-           width = W_WIDTH(wp);
+           width = wp->w_width;
        }
        else
        {
index 39e353c37623528e6173f4a381a61b0c1cb2b88d..15d9b81f774b24aabba1af4784c130193f025a78 100644 (file)
@@ -2608,7 +2608,7 @@ showmatch(
        if (!curwin->w_p_wrap)
            getvcol(curwin, lpos, NULL, &vcol, NULL);
        if (curwin->w_p_wrap || (vcol >= curwin->w_leftcol
-                              && vcol < curwin->w_leftcol + W_WIDTH(curwin)))
+                              && vcol < curwin->w_leftcol + curwin->w_width))
        {
            mpos = *lpos;    /* save the pos, update_screen() may change it */
            save_cursor = curwin->w_cursor;
index 768ff586bd78e0b28e8e98057d80b568b8deeecc..4582dca95b4528fedbaa1129804c358c65b5504b 100644 (file)
@@ -2701,8 +2701,7 @@ struct window_S
                                       status/command/winbar line(s) */
     int                w_status_height;    /* number of status lines (0 or 1) */
     int                w_wincol;           /* Leftmost column of window in screen. */
-    int                w_width;            /* Width of window, excluding separation.
-                                      use W_WIDTH() */
+    int                w_width;            /* Width of window, excluding separation. */
     int                w_vsep_width;       /* Number of separator columns (0 or 1).
                                       use W_VSEP_WIDTH() */
     /*
index 64553b1fede0798c525a436bc1ebc9b85250f1c4..867b8a5017738ae62fb1b08ea78d195173109fab 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -2739,7 +2739,7 @@ retnomove:
 #ifdef FEAT_FOLDING
                        && (
 # ifdef FEAT_RIGHTLEFT
-                           wp->w_p_rl ? col < W_WIDTH(wp) - wp->w_p_fdc :
+                           wp->w_p_rl ? col < wp->w_width - wp->w_p_fdc :
 # endif
                            col >= wp->w_p_fdc
 # ifdef FEAT_CMDWIN
@@ -2945,7 +2945,7 @@ retnomove:
     /* Check for position outside of the fold column. */
     if (
 # ifdef FEAT_RIGHTLEFT
-           curwin->w_p_rl ? col < W_WIDTH(curwin) - curwin->w_p_fdc :
+           curwin->w_p_rl ? col < curwin->w_width - curwin->w_p_fdc :
 # endif
            col >= curwin->w_p_fdc
 #  ifdef FEAT_CMDWIN
@@ -3020,7 +3020,7 @@ mouse_comp_pos(
 
 #ifdef FEAT_RIGHTLEFT
     if (win->w_p_rl)
-       col = W_WIDTH(win) - 1 - col;
+       col = win->w_width - 1 - col;
 #endif
 
     lnum = win->w_topline;
@@ -3064,7 +3064,7 @@ mouse_comp_pos(
        off = win_col_off(win) - win_col_off2(win);
        if (col < off)
            col = off;
-       col += row * (W_WIDTH(win) - off);
+       col += row * (win->w_width - off);
        /* add skip column (for long wrapping line) */
        col += win->w_skipcol;
     }
index 6facb341dced012bf8473b2f18746d6f57bc8004..5d57a353cd58cfce22c72dfc8fc4d071586d3efb 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1136,
 /**/
     1135,
 /**/
index 8153ef834e07b032f8e264bd15b6f816b3d438c2..1c91b7dd66302f031298ad90832895d5265a75e5 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -859,7 +859,6 @@ extern int (*dyn_libintl_putenv)(const char *envstring);
 #define FINDFILE_DIR   1       /* only directories */
 #define FINDFILE_BOTH  2       /* files and directories */
 
-#define W_WIDTH(wp)    (wp->w_width)
 #define W_ENDCOL(wp)   (wp->w_wincol + wp->w_width)
 #define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
 #define W_STATUS_HEIGHT(wp) (wp->w_status_height)
index ca56d9cc7ddd4ace3be12a9891665ca80f017477..a290807a0c46d9b0d722cf2c92ab441cad530fc1 100644 (file)
@@ -5777,13 +5777,13 @@ scroll_to_fraction(win_T *wp, int prev_height)
             */
            wp->w_wrow = line_size;
            if (wp->w_wrow >= wp->w_height
-                                      && (W_WIDTH(wp) - win_col_off(wp)) > 0)
+                                      && (wp->w_width - win_col_off(wp)) > 0)
            {
-               wp->w_skipcol += W_WIDTH(wp) - win_col_off(wp);
+               wp->w_skipcol += wp->w_width - win_col_off(wp);
                --wp->w_wrow;
                while (wp->w_wrow >= wp->w_height)
                {
-                   wp->w_skipcol += W_WIDTH(wp) - win_col_off(wp)
+                   wp->w_skipcol += wp->w_width - win_col_off(wp)
                                                           + win_col_off2(wp);
                    --wp->w_wrow;
                }