@@ -1082,7 +1082,6 @@ popup_adjust_position(win_T *wp)
10821082 int org_leftoff = wp -> w_popup_leftoff ;
10831083 int minwidth ;
10841084 int wantline = wp -> w_wantline ; // adjusted for textprop
1085- int use_wantline = wantline != 0 ;
10861085 int wantcol = wp -> w_wantcol ; // adjusted for textprop
10871086 int use_wantcol = wantcol != 0 ;
10881087
@@ -1097,15 +1096,6 @@ popup_adjust_position(win_T *wp)
10971096 if (wp -> w_popup_last_curline != wp -> w_cursor .lnum )
10981097 popup_highlight_curline (wp );
10991098
1100- // If no line was specified default to vertical centering.
1101- if (wantline == 0 )
1102- center_vert = TRUE;
1103- else if (wantline < 0 )
1104- // If "wantline" is negative it actually means zero.
1105- wantline = 0 ;
1106- if (wantcol < 0 )
1107- wantcol = 0 ;
1108-
11091099 if (wp -> w_popup_prop_type > 0 && win_valid (wp -> w_popup_prop_win ))
11101100 {
11111101 win_T * prop_win = wp -> w_popup_prop_win ;
@@ -1159,6 +1149,19 @@ popup_adjust_position(win_T *wp)
11591149 else
11601150 // left of the text
11611151 wantcol = screen_scol + wantcol - 2 ;
1152+ use_wantcol = TRUE;
1153+ }
1154+ else
1155+ {
1156+ // If no line was specified default to vertical centering.
1157+ if (wantline == 0 )
1158+ center_vert = TRUE;
1159+ else if (wantline < 0 )
1160+ // If "wantline" is negative it actually means zero.
1161+ wantline = 0 ;
1162+ if (wantcol < 0 )
1163+ // If "wantcol" is negative it actually means zero.
1164+ wantcol = 0 ;
11621165 }
11631166
11641167 if (wp -> w_popup_pos == POPPOS_CENTER )
@@ -1169,8 +1172,8 @@ popup_adjust_position(win_T *wp)
11691172 }
11701173 else
11711174 {
1172- if (use_wantline && (wp -> w_popup_pos == POPPOS_TOPLEFT
1173- || wp -> w_popup_pos == POPPOS_TOPRIGHT ))
1175+ if (wantline > 0 && (wp -> w_popup_pos == POPPOS_TOPLEFT
1176+ || wp -> w_popup_pos == POPPOS_TOPRIGHT ))
11741177 {
11751178 wp -> w_winrow = wantline - 1 ;
11761179 if (wp -> w_winrow >= Rows )
0 commit comments