Skip to content

Commit 53f8174

Browse files
committed
patch 8.0.1135: W_WINCOL() is always the same
Problem: W_WINCOL() is always the same. Solution: Expand the macro.
1 parent 7630195 commit 53f8174

15 files changed

Lines changed: 40 additions & 40 deletions

src/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ edit_putchar(int c, int highlight)
17761776
else
17771777
attr = 0;
17781778
pc_row = W_WINROW(curwin) + curwin->w_wrow;
1779-
pc_col = W_WINCOL(curwin);
1779+
pc_col = curwin->w_wincol;
17801780
#if defined(FEAT_RIGHTLEFT) || defined(FEAT_MBYTE)
17811781
pc_status = PC_STATUS_UNSET;
17821782
#endif

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9111,7 +9111,7 @@ ex_sleep(exarg_T *eap)
91119111
{
91129112
n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
91139113
if (n >= 0)
9114-
windgoto((int)n, W_WINCOL(curwin) + curwin->w_wcol);
9114+
windgoto((int)n, curwin->w_wincol + curwin->w_wcol);
91159115
}
91169116

91179117
len = eap->line2;

src/gui_gtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ popup_menu_position_func(GtkMenu *menu UNUSED,
19541954
# endif
19551955
{
19561956
/* Find the cursor position in the current window */
1957-
*x += FILL_X(W_WINCOL(curwin) + curwin->w_wcol + 1) + 1;
1957+
*x += FILL_X(curwin->w_wincol + curwin->w_wcol + 1) + 1;
19581958
*y += FILL_Y(W_WINROW(curwin) + curwin->w_wrow + 1) + 1;
19591959
}
19601960
}

src/gui_w32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6608,7 +6608,7 @@ gui_make_popup(char_u *path_name, int mouse_pos)
66086608
}
66096609
else if (curwin != NULL)
66106610
{
6611-
p.x += TEXT_X(W_WINCOL(curwin) + curwin->w_wcol + 1);
6611+
p.x += TEXT_X(curwin->w_wincol + curwin->w_wcol + 1);
66126612
p.y += TEXT_Y(W_WINROW(curwin) + curwin->w_wrow + 1);
66136613
}
66146614
msg_scroll = FALSE;

src/if_py_both.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3877,7 +3877,7 @@ WindowAttr(WindowObject *self, char *name)
38773877
else if (strcmp(name, "width") == 0)
38783878
return PyLong_FromLong((long)(W_WIDTH(self->win)));
38793879
else if (strcmp(name, "col") == 0)
3880-
return PyLong_FromLong((long)(W_WINCOL(self->win)));
3880+
return PyLong_FromLong((long)(self->win->w_wincol));
38813881
else if (strcmp(name, "vars") == 0)
38823882
return NEW_DICTIONARY(self->win->w_vars);
38833883
else if (strcmp(name, "options") == 0)

src/netbeans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,7 @@ netbeans_button_release(int button)
28722872

28732873
if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
28742874
{
2875-
int col = mouse_col - W_WINCOL(curwin)
2875+
int col = mouse_col - curwin->w_wincol
28762876
- ((curwin->w_p_nu || curwin->w_p_rnu) ? 9 : 1);
28772877
long off = pos2off(curbuf, &curwin->w_cursor);
28782878

src/popupmnu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ pum_display(
190190
/* Calculate column */
191191
#ifdef FEAT_RIGHTLEFT
192192
if (curwin->w_p_rl)
193-
col = W_WINCOL(curwin) + W_WIDTH(curwin) - curwin->w_wcol - 1;
193+
col = curwin->w_wincol + W_WIDTH(curwin) - curwin->w_wcol - 1;
194194
else
195195
#endif
196-
col = W_WINCOL(curwin) + curwin->w_wcol;
196+
col = curwin->w_wincol + curwin->w_wcol;
197197

198198
/* if there are more items than room we need a scrollbar */
199199
if (pum_height < size)
@@ -312,7 +312,7 @@ pum_redraw(void)
312312
#ifdef FEAT_RIGHTLEFT
313313
if (curwin->w_p_rl)
314314
{
315-
if (pum_col < W_WINCOL(curwin) + W_WIDTH(curwin) - 1)
315+
if (pum_col < curwin->w_wincol + W_WIDTH(curwin) - 1)
316316
screen_putchar(' ', row, pum_col + 1, attr);
317317
}
318318
else

src/screen.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,10 +2211,10 @@ win_update(win_T *wp)
22112211
/*
22122212
* Last line isn't finished: Display "@@@" in the last screen line.
22132213
*/
2214-
screen_puts_len((char_u *)"@@", 2, scr_row, W_WINCOL(wp),
2214+
screen_puts_len((char_u *)"@@", 2, scr_row, wp->w_wincol,
22152215
HL_ATTR(HLF_AT));
22162216
screen_fill(scr_row, scr_row + 1,
2217-
(int)W_WINCOL(wp) + 2, (int)W_ENDCOL(wp),
2217+
(int)wp->w_wincol + 2, (int)W_ENDCOL(wp),
22182218
'@', ' ', HL_ATTR(HLF_AT));
22192219
set_empty_rows(wp, srow);
22202220
wp->w_botline = lnum;
@@ -2375,7 +2375,7 @@ win_draw_end(
23752375
}
23762376
# endif
23772377
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
2378-
W_WINCOL(wp), W_ENDCOL(wp) - 1 - FDC_OFF,
2378+
wp->w_wincol, W_ENDCOL(wp) - 1 - FDC_OFF,
23792379
c2, c2, HL_ATTR(hl));
23802380
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
23812381
W_ENDCOL(wp) - 1 - FDC_OFF, W_ENDCOL(wp) - FDC_OFF,
@@ -2392,7 +2392,7 @@ win_draw_end(
23922392
if (n > wp->w_width)
23932393
n = wp->w_width;
23942394
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
2395-
W_WINCOL(wp), (int)W_WINCOL(wp) + n,
2395+
wp->w_wincol, (int)wp->w_wincol + n,
23962396
cmdwin_type, ' ', HL_ATTR(HLF_AT));
23972397
}
23982398
#endif
@@ -2405,7 +2405,7 @@ win_draw_end(
24052405
if (nn > W_WIDTH(wp))
24062406
nn = W_WIDTH(wp);
24072407
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
2408-
W_WINCOL(wp) + n, (int)W_WINCOL(wp) + nn,
2408+
wp->w_wincol + n, (int)wp->w_wincol + nn,
24092409
' ', ' ', HL_ATTR(HLF_FC));
24102410
n = nn;
24112411
}
@@ -2419,13 +2419,13 @@ win_draw_end(
24192419
if (nn > W_WIDTH(wp))
24202420
nn = W_WIDTH(wp);
24212421
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
2422-
W_WINCOL(wp) + n, (int)W_WINCOL(wp) + nn,
2422+
wp->w_wincol + n, (int)wp->w_wincol + nn,
24232423
' ', ' ', HL_ATTR(HLF_SC));
24242424
n = nn;
24252425
}
24262426
#endif
24272427
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
2428-
W_WINCOL(wp) + FDC_OFF, (int)W_ENDCOL(wp),
2428+
wp->w_wincol + FDC_OFF, (int)W_ENDCOL(wp),
24292429
c1, c2, HL_ATTR(hl));
24302430
}
24312431
set_empty_rows(wp, row);
@@ -2894,7 +2894,7 @@ fold_line(
28942894
}
28952895
#endif
28962896

2897-
screen_line(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
2897+
screen_line(row + W_WINROW(wp), wp->w_wincol, (int)W_WIDTH(wp),
28982898
(int)W_WIDTH(wp), FALSE);
28992899

29002900
/*
@@ -4016,7 +4016,7 @@ win_line(
40164016
#endif
40174017
)
40184018
{
4019-
screen_line(screen_row, W_WINCOL(wp), col, -(int)W_WIDTH(wp),
4019+
screen_line(screen_row, wp->w_wincol, col, -(int)W_WIDTH(wp),
40204020
HAS_RIGHTLEFT(wp->w_p_rl));
40214021
/* Pretend we have finished updating the window. Except when
40224022
* 'cursorcolumn' is set. */
@@ -5488,7 +5488,7 @@ win_line(
54885488
}
54895489
#endif
54905490

5491-
screen_line(screen_row, W_WINCOL(wp), col,
5491+
screen_line(screen_row, wp->w_wincol, col,
54925492
(int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
54935493
row++;
54945494

@@ -5794,11 +5794,11 @@ win_line(
57945794
)
57955795
{
57965796
#ifdef FEAT_CONCEAL
5797-
screen_line(screen_row, W_WINCOL(wp), col - boguscols,
5797+
screen_line(screen_row, wp->w_wincol, col - boguscols,
57985798
(int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
57995799
boguscols = 0;
58005800
#else
5801-
screen_line(screen_row, W_WINCOL(wp), col,
5801+
screen_line(screen_row, wp->w_wincol, col,
58025802
(int)W_WIDTH(wp), HAS_RIGHTLEFT(wp->w_p_rl));
58035803
#endif
58045804
++row;
@@ -6931,14 +6931,14 @@ win_redr_status(win_T *wp)
69316931
}
69326932

69336933
row = W_WINROW(wp) + wp->w_height;
6934-
screen_puts(p, row, W_WINCOL(wp), attr);
6935-
screen_fill(row, row + 1, len + W_WINCOL(wp),
6936-
this_ru_col + W_WINCOL(wp), fillchar, fillchar, attr);
6934+
screen_puts(p, row, wp->w_wincol, attr);
6935+
screen_fill(row, row + 1, len + wp->w_wincol,
6936+
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);
69376937

69386938
if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)
69396939
&& (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
69406940
screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
6941-
- 1 + W_WINCOL(wp)), attr);
6941+
- 1 + wp->w_wincol), attr);
69426942

69436943
#ifdef FEAT_CMDL_INFO
69446944
win_redr_ruler(wp, TRUE);
@@ -7167,7 +7167,7 @@ win_redr_custom(
71677167
# endif
71687168
}
71697169

7170-
col += W_WINCOL(wp);
7170+
col += wp->w_wincol;
71717171
}
71727172

71737173
if (maxwidth <= 0)
@@ -9418,7 +9418,7 @@ setcursor(void)
94189418
{
94199419
validate_cursor();
94209420
windgoto(W_WINROW(curwin) + curwin->w_wrow,
9421-
W_WINCOL(curwin) + (
9421+
curwin->w_wincol + (
94229422
#ifdef FEAT_RIGHTLEFT
94239423
/* With 'rightleft' set and the cursor on a double-wide
94249424
* character, position it on the leftmost column. */
@@ -9495,7 +9495,7 @@ win_ins_lines(
94959495
if (lastrow > Rows)
94969496
lastrow = Rows;
94979497
screen_fill(nextrow - line_count, lastrow - line_count,
9498-
W_WINCOL(wp), (int)W_ENDCOL(wp),
9498+
wp->w_wincol, (int)W_ENDCOL(wp),
94999499
' ', ' ', 0);
95009500
}
95019501

@@ -9606,7 +9606,7 @@ win_do_lines(
96069606
if (row + line_count >= wp->w_height)
96079607
{
96089608
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + wp->w_height,
9609-
W_WINCOL(wp), (int)W_ENDCOL(wp),
9609+
wp->w_wincol, (int)W_ENDCOL(wp),
96109610
' ', ' ', 0);
96119611
return OK;
96129612
}
@@ -10768,7 +10768,7 @@ redraw_win_toolbar(win_T *wp)
1076810768
}
1076910769
wp->w_winbar_items[item_idx].wb_menu = NULL; /* end marker */
1077010770

10771-
screen_line(wp->w_winrow, W_WINCOL(wp), (int)W_WIDTH(wp),
10771+
screen_line(wp->w_winrow, wp->w_wincol, (int)W_WIDTH(wp),
1077210772
(int)W_WIDTH(wp), FALSE);
1077310773
}
1077410774
#endif
@@ -10900,7 +10900,7 @@ win_redr_ruler(win_T *wp, int always)
1090010900
{
1090110901
row = W_WINROW(wp) + wp->w_height;
1090210902
fillchar = fillchar_status(&attr, wp);
10903-
off = W_WINCOL(wp);
10903+
off = wp->w_wincol;
1090410904
width = W_WIDTH(wp);
1090510905
}
1090610906
else

src/structs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,8 +2700,7 @@ struct window_S
27002700
int w_height; /* number of rows in window, excluding
27012701
status/command/winbar line(s) */
27022702
int w_status_height; /* number of status lines (0 or 1) */
2703-
int w_wincol; /* Leftmost column of window in screen.
2704-
use W_WINCOL() */
2703+
int w_wincol; /* Leftmost column of window in screen. */
27052704
int w_width; /* Width of window, excluding separation.
27062705
use W_WIDTH() */
27072706
int w_vsep_width; /* Number of separator columns (0 or 1).

src/term.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,8 +3816,8 @@ scroll_region_set(win_T *wp, int off)
38163816
OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1,
38173817
W_WINROW(wp) + off));
38183818
if (*T_CSV != NUL && wp->w_width != Columns)
3819-
OUT_STR(tgoto((char *)T_CSV, W_WINCOL(wp) + wp->w_width - 1,
3820-
W_WINCOL(wp)));
3819+
OUT_STR(tgoto((char *)T_CSV, wp->w_wincol + wp->w_width - 1,
3820+
wp->w_wincol));
38213821
screen_start(); /* don't know where cursor is now */
38223822
}
38233823

0 commit comments

Comments
 (0)