summaryrefslogtreecommitdiffstats
path: root/src/move.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-22 15:20:32 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-22 15:20:32 +0200
commit0263146b5dbbb6c120ce2e7720256503b864425d (patch)
treeb6f18fde8fd4bbc29c322b414ac584106e512d7a /src/move.c
parent53f8174eaeb93b381cf74c58863f8fe82748a22a (diff)
patch 8.0.1136: W_WIDTH() is always the samev8.0.1136
Problem: W_WIDTH() is always the same. Solution: Expand the macro.
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/move.c b/src/move.c
index c520f5fd51..4e5618d7b7 100644
--- a/src/move.c
+++ b/src/move.c
@@ -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)
{