Skip to content

Commit a2fc199

Browse files
committed
fix
1 parent 885a007 commit a2fc199

File tree

10 files changed

+163
-165
lines changed

10 files changed

+163
-165
lines changed

src/clipboard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ clip_invert_rectangle(
404404
gui_mch_invert_rectangle(row, col, height, width);
405405
else
406406
#endif
407-
screen_draw_rectangle(row, col + TPL_LCOL(NULL), height, width, invert);
407+
screen_draw_rectangle(row, col + NOUSE_TPL_LCOL(NULL), height, width, invert);
408408
#ifdef FEAT_PROP_POPUP
409409
screen_zindex = 0;
410410
#endif

src/drawscreen.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,9 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
572572
fillchar = fillchar_status(&attr, wp);
573573
else
574574
fillchar = fillchar_vsep(&attr, wp);
575-
if (W_ENDCOL(wp) < COLUMNS_WITHOUT_TPL())
576-
screen_putchar(fillchar, row, W_ENDCOL(wp) + NOUSE_TPL_LCOL(wp), attr);
575+
// if (W_ENDCOL(wp) < COLUMNS_WITHOUT_TPL())
576+
// screen_putchar(fillchar, row, W_ENDCOL(wp) + NOUSE_TPL_LCOL(wp), attr);
577+
screen_putchar(fillchar, row, W_ENDCOL(wp), attr);
577578
}
578579
busy = FALSE;
579580
}

src/gui.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4907,7 +4907,7 @@ xy2win(int x, int y, mouse_find_T popup)
49074907
row = Y_2_ROW(y);
49084908
col = X_2_COL(x);
49094909

4910-
col -= TPL_LCOL(NULL);
4910+
//col -= TPL_LCOL(NULL);
49114911

49124912
if (row < 0 || col < 0) // before first window
49134913
return NULL;
@@ -5379,8 +5379,8 @@ gui_wingoto_xy(int x, int y)
53795379
int col = X_2_COL(x);
53805380
win_T *wp;
53815381

5382-
col -= TPL_LCOL(NULL);
5383-
5382+
// col -= TPL_LCOL(NULL);
5383+
//
53845384
if (row < 0 || col < 0)
53855385
return;
53865386

src/mouse.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,10 +1725,6 @@ jump_to_mouse(
17251725
int mouse_char = ' ';
17261726
#endif
17271727

1728-
col -= TPL_LCOL(NULL);
1729-
if (col < 0)
1730-
return IN_TABPANEL;
1731-
17321728
mouse_past_bottom = FALSE;
17331729
mouse_past_eol = FALSE;
17341730

@@ -1813,7 +1809,7 @@ jump_to_mouse(
18131809

18141810
if (!(flags & MOUSE_FOCUS))
18151811
{
1816-
if (row < 0 || col + TPL_LCOL(NULL) < 0) // check if it makes sense
1812+
if (row < 0 || col + NOUSE_TPL_LCOL(NULL) < 0) // check if it makes sense
18171813
return IN_UNKNOWN;
18181814

18191815
// find the window where the row is in and adjust "row" and "col" to be
@@ -3221,6 +3217,7 @@ mouse_find_win(int *rowp, int *colp, mouse_find_T popup UNUSED)
32213217

32223218
fp = topframe;
32233219
*rowp -= firstwin->w_winrow;
3220+
*colp -= TPL_LCOL(NULL);
32243221
for (;;)
32253222
{
32263223
if (fp->fr_layout == FR_LEAF)
@@ -3333,9 +3330,9 @@ f_getmousepos(typval_T *argvars UNUSED, typval_T *rettv)
33333330
winid = wp->w_id;
33343331
winrow = row + 1;
33353332
wincol = col + 1;
3336-
wincol -= TPL_LCOL(NULL);
3337-
if (wincol < 0)
3338-
wincol = 0;
3333+
// wincol -= TPL_LCOL(NULL);
3334+
// if (wincol < 0)
3335+
// wincol = 0;
33393336
row -= top_off;
33403337
col -= left_off;
33413338
if (row >= 0 && row < wp->w_height && col >= 0 && col < wp->w_width)

src/popupmenu.c

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -658,25 +658,22 @@ pum_display_rtl_text(
658658
width = cells + over_cell + 1;
659659
rt = orig_rt;
660660

661-
screen_putchar(truncrl, row,
662-
col - width + 1 + TPL_LCOL(NULL), trunc_attr);
661+
screen_putchar(truncrl, row, col - width + 1, trunc_attr);
663662

664663
if (over_cell > 0)
665-
screen_fill(row, row + 1, col - width + 2 + TPL_LCOL(NULL),
666-
col - width + 2 + over_cell + TPL_LCOL(NULL), ' ', ' ',
667-
attr);
664+
screen_fill(row, row + 1, col - width + 2,
665+
col - width + 2 + over_cell, ' ', ' ', attr);
668666
}
669667

670668
if (attrs == NULL)
671-
screen_puts_len(rt, (int)STRLEN(rt), row,
672-
col - cells + 1 + TPL_LCOL(NULL), attr);
669+
screen_puts_len(rt, (int)STRLEN(rt), row, col - cells + 1, attr);
673670
else
674-
pum_screen_puts_with_attrs(row, col - cells + 1 + TPL_LCOL(NULL),
675-
cells, rt, (int)STRLEN(rt), attrs);
671+
pum_screen_puts_with_attrs(row, col - cells + 1, cells, rt,
672+
(int)STRLEN(rt), attrs);
676673

677674
vim_free(rt_start);
678675
VIM_CLEAR(st);
679-
return col - width + TPL_LCOL(NULL);
676+
return col - width;
680677
}
681678
#endif
682679

@@ -750,19 +747,17 @@ pum_display_ltr_text(
750747
}
751748

752749
if (attrs == NULL)
753-
screen_puts_len(st, size, row, col + TPL_LCOL(NULL), attr);
750+
screen_puts_len(st, size, row, col, attr);
754751
else
755-
pum_screen_puts_with_attrs(row, col + TPL_LCOL(NULL), cells, st, size,
756-
attrs);
752+
pum_screen_puts_with_attrs(row, col, cells, st, size, attrs);
757753

758754
if (truncated)
759755
{
760756
if (over_cell > 0)
761-
screen_fill(row, row + 1, col + cells + TPL_LCOL(NULL),
762-
col + cells + over_cell + TPL_LCOL(NULL), ' ', ' ', attr);
757+
screen_fill(row, row + 1, col + cells,
758+
col + cells + over_cell, ' ', ' ', attr);
763759

764-
screen_putchar(trunc, row,
765-
col + cells + over_cell + TPL_LCOL(NULL), trunc_attr);
760+
screen_putchar(trunc, row, col + cells + over_cell, trunc_attr);
766761
}
767762

768763
VIM_CLEAR(st);
@@ -873,10 +868,10 @@ pum_draw_scrollbar(
873868

874869
#ifdef FEAT_RIGHTLEFT
875870
if (pum_rl)
876-
screen_putchar(' ', row, pum_col - pum_width + TPL_LCOL(NULL), attr);
871+
screen_putchar(' ', row, pum_col - pum_width, attr);
877872
else
878873
#endif
879-
screen_putchar(' ', row, pum_col + pum_width + TPL_LCOL(NULL), attr);
874+
screen_putchar(' ', row, pum_col + pum_width, attr);
880875
}
881876

882877
/*
@@ -959,12 +954,12 @@ pum_redraw(void)
959954
if (pum_rl)
960955
{
961956
if (pum_col < curwin->w_wincol + curwin->w_width - 1)
962-
screen_putchar(' ', row, pum_col + 1 + TPL_LCOL(NULL), attr);
957+
screen_putchar(' ', row, pum_col + 1, attr);
963958
}
964959
else
965960
#endif
966961
if (pum_col > 0)
967-
screen_putchar(' ', row, pum_col - 1 + TPL_LCOL(NULL), attr);
962+
screen_putchar(' ', row, pum_col - 1, attr);
968963

969964
// Display each entry, use two spaces for a Tab.
970965
// Do this 3 times and order from p_cia
@@ -1005,31 +1000,28 @@ pum_redraw(void)
10051000
#ifdef FEAT_RIGHTLEFT
10061001
if (pum_rl)
10071002
{
1008-
screen_fill(row, row + 1, pum_col - basic_width - n + 1 + TPL_LCOL(NULL),
1009-
col + 1 + TPL_LCOL(NULL), ' ', ' ', orig_attr);
1003+
screen_fill(row, row + 1, pum_col - basic_width - n + 1,
1004+
col + 1, ' ', ' ', orig_attr);
10101005
col = pum_col - basic_width - n;
10111006
}
10121007
else
10131008
#endif
10141009
{
1015-
screen_fill(row, row + 1, col + TPL_LCOL(NULL),
1016-
pum_col + basic_width + n + TPL_LCOL(NULL), ' ', ' ',
1017-
orig_attr);
1010+
screen_fill(row, row + 1, col, pum_col + basic_width + n,
1011+
' ', ' ', orig_attr);
10181012
col = pum_col + basic_width + n;
10191013
}
10201014
totwidth = basic_width + n;
10211015
}
10221016

10231017
#ifdef FEAT_RIGHTLEFT
10241018
if (pum_rl)
1025-
screen_fill(row, row + 1,
1026-
pum_col - pum_width + 1 + TPL_LCOL(NULL),
1027-
col + 1 + TPL_LCOL(NULL), ' ', ' ', orig_attr);
1019+
screen_fill(row, row + 1, pum_col - pum_width + 1, col + 1, ' ',
1020+
' ', orig_attr);
10281021
else
10291022
#endif
1030-
screen_fill(row, row + 1, col + TPL_LCOL(NULL),
1031-
pum_col + pum_width + TPL_LCOL(NULL),
1032-
' ', ' ', orig_attr);
1023+
screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ',
1024+
orig_attr);
10331025
pum_draw_scrollbar(row, i, thumb_pos, thumb_height);
10341026

10351027
++row;

src/popupwin.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ popup_options_one(dict_T *dict, char_u *key)
8686
if (STRCMP(key, "line") == 0)
8787
n = screen_screenrow() + 1 + n;
8888
else // "col"
89-
n = screen_screencol() + 1 + n - TPL_LCOL(NULL);
89+
n = screen_screencol() + 1 + n - NOUSE_TPL_LCOL(NULL);
9090

9191
// Zero means "not set", use -1 instead.
9292
if (n == 0)
@@ -1545,7 +1545,7 @@ popup_adjust_position(win_T *wp)
15451545
}
15461546
if (center_hor)
15471547
{
1548-
wp->w_wincol = (Columns - wp->w_width - extra_width - TPL_LCOL(NULL)) / 2;
1548+
wp->w_wincol = (Columns - wp->w_width - extra_width - NOUSE_TPL_LCOL(NULL)) / 2;
15491549
if (wp->w_wincol < 0)
15501550
wp->w_wincol = 0;
15511551
}
@@ -4081,7 +4081,7 @@ update_popups(void (*win_update)(win_T *wp))
40814081
// win_update() doesn't handle them.
40824082
top_off = popup_top_extra(wp);
40834083
left_extra = wp->w_popup_padding[3] + wp->w_popup_border[3]
4084-
+ TPL_LCOL(NULL) - wp->w_popup_leftoff;
4084+
+ NOUSE_TPL_LCOL(NULL) - wp->w_popup_leftoff;
40854085
if (wp->w_wincol + left_extra < 0)
40864086
left_extra = -wp->w_wincol;
40874087
wp->w_winrow += top_off;
@@ -4163,7 +4163,7 @@ update_popups(void (*win_update)(win_T *wp))
41634163
}
41644164

41654165
// Title goes on top of border or padding.
4166-
title_wincol = wp->w_wincol + 1 + TPL_LCOL(NULL);
4166+
title_wincol = wp->w_wincol + 1 + NOUSE_TPL_LCOL(NULL);
41674167
if (wp->w_popup_title != NULL)
41684168
{
41694169
title_len = vim_strsize(wp->w_popup_title);
@@ -4191,7 +4191,7 @@ update_popups(void (*win_update)(win_T *wp))
41914191
wp->w_popup_border[0] > 0 ? border_attr[0] : popup_attr);
41924192
}
41934193

4194-
wincol = wp->w_wincol - wp->w_popup_leftoff + TPL_LCOL(NULL);
4194+
wincol = wp->w_wincol - wp->w_popup_leftoff + NOUSE_TPL_LCOL(NULL);
41954195
top_padding = wp->w_popup_padding[0];
41964196
if (wp->w_popup_border[0] > 0)
41974197
{
@@ -4229,7 +4229,7 @@ update_popups(void (*win_update)(win_T *wp))
42294229
{
42304230
padcol = wincol + wp->w_popup_border[3];
42314231
padendcol = wp->w_wincol + total_width - wp->w_popup_border[1]
4232-
+ TPL_LCOL(NULL) - wp->w_has_scrollbar;
4232+
+ NOUSE_TPL_LCOL(NULL) - wp->w_has_scrollbar;
42334233
if (padcol < 0)
42344234
{
42354235
padendcol += padcol;
@@ -4327,7 +4327,7 @@ update_popups(void (*win_update)(win_T *wp))
43274327
if (wp->w_has_scrollbar)
43284328
{
43294329
int line = i - top_off;
4330-
int scroll_col = wp->w_wincol + total_width - 1 + TPL_LCOL(NULL)
4330+
int scroll_col = wp->w_wincol + total_width - 1 + NOUSE_TPL_LCOL(NULL)
43314331
- wp->w_popup_border[1];
43324332

43334333
if (line >= 0 && line < wp->w_height)

src/screen.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ screen_fill_end(
156156
if (wp->w_p_rl)
157157
{
158158
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
159-
W_ENDCOL(wp) - nn + NOUSE_TPL_LCOL(wp), (int)W_ENDCOL(wp) - off + TPL_LCOL(wp),
159+
W_ENDCOL(wp) - nn + NOUSE_TPL_LCOL(wp), (int)W_ENDCOL(wp) - off + NOUSE_TPL_LCOL(wp),
160160
c1, c2, attr);
161161
}
162162
else
163163
#endif
164164
screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
165-
wp->w_wincol + off + NOUSE_TPL_LCOL(wp), (int)wp->w_wincol + nn + TPL_LCOL(wp),
165+
wp->w_wincol + off + NOUSE_TPL_LCOL(wp), (int)wp->w_wincol + nn + NOUSE_TPL_LCOL(wp),
166166
c1, c2, attr);
167167
return nn;
168168
}
@@ -395,9 +395,9 @@ blocked_by_popup(int row, int col)
395395

396396
if (!popup_visible)
397397
return FALSE;
398-
if (col < TPL_LCOL(NULL))
399-
return FALSE;
400-
off = row * screen_Columns + col - TPL_LCOL(NULL);
398+
// if (col < TPL_LCOL(NULL))
399+
// return FALSE;
400+
off = row * screen_Columns + col - NOUSE_TPL_LCOL(NULL);
401401
return popup_mask[off] > screen_zindex || popup_transparent[off];
402402
}
403403
#endif
@@ -857,7 +857,7 @@ screen_line(
857857
{
858858
// For a window that has a right neighbor, draw the separator char
859859
// right of the window contents. But not on top of a popup window.
860-
if (coloff + col < TPL_LCOL(NULL) + COLUMNS_WITHOUT_TPL())
860+
if (coloff + col < NOUSE_TPL_LCOL(NULL) + NOUSE_COLUMNS_WITHOUT_TPL())
861861
{
862862
if (!skip_for_popup(row, col + coloff))
863863
{
@@ -1056,6 +1056,7 @@ win_redr_custom(
10561056
// Use 'tabline'. Always at the first line of the screen.
10571057
stl = p_tal;
10581058
row = 0;
1059+
col = TPL_LCOL(NULL);
10591060
fillchar = ' ';
10601061
attr = HL_ATTR(HLF_TPF);
10611062
maxwidth = COLUMNS_WITHOUT_TPL();
@@ -1181,7 +1182,7 @@ win_redr_custom(
11811182
if (wp == NULL)
11821183
{
11831184
// Fill the TabPageIdxs[] array for clicking in the tab pagesline.
1184-
col = 0;
1185+
col = TPL_LCOL(NULL);
11851186
len = 0;
11861187
p = buf;
11871188
fillchar = 0;
@@ -1193,7 +1194,7 @@ win_redr_custom(
11931194
p = tabtab[n].start;
11941195
fillchar = tabtab[n].userhl;
11951196
}
1196-
while (col < COLUMNS_WITHOUT_TPL())
1197+
while (col < NOUSE_COLUMNS_WITHOUT_TPL())
11971198
TabPageIdxs[col++] = fillchar;
11981199
}
11991200

0 commit comments

Comments
 (0)