Mercurial > vim
comparison src/popupwin.c @ 17811:b5499bf22a97 v8.1.1902
patch 8.1.1902: cannot have an info popup without a border
Commit: https://github.com/vim/vim/commit/bd483b3f577ee1af7c8c8bf440f5d81613336975
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 21 15:13:41 2019 +0200
patch 8.1.1902: cannot have an info popup without a border
Problem: Cannot have an info popup without a border.
Solution: Add the "border" item to 'completepopup'.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Aug 2019 15:15:03 +0200 |
parents | 55c167b08c2b |
children | 9ec2526c04c5 |
comparison
equal
deleted
inserted
replaced
17810:e67a904463f9 | 17811:b5499bf22a97 |
---|---|
933 } | 933 } |
934 | 934 |
935 /* | 935 /* |
936 * Get the padding plus border at the top, adjusted to 1 if there is a title. | 936 * Get the padding plus border at the top, adjusted to 1 if there is a title. |
937 */ | 937 */ |
938 static int | 938 int |
939 popup_top_extra(win_T *wp) | 939 popup_top_extra(win_T *wp) |
940 { | 940 { |
941 int extra = wp->w_popup_border[0] + wp->w_popup_padding[0]; | 941 int extra = wp->w_popup_border[0] + wp->w_popup_padding[0]; |
942 | 942 |
943 if (extra == 0 && wp->w_popup_title != NULL && *wp->w_popup_title != NUL) | 943 if (extra == 0 && wp->w_popup_title != NULL && *wp->w_popup_title != NUL) |
1346 | 1346 |
1347 *p = NUL; | 1347 *p = NUL; |
1348 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1, | 1348 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1, |
1349 s + 10, OPT_FREE|OPT_LOCAL, 0); | 1349 s + 10, OPT_FREE|OPT_LOCAL, 0); |
1350 *p = c; | 1350 *p = c; |
1351 } | |
1352 } | |
1353 else if (STRNCMP(s, "border:", 7) == 0) | |
1354 { | |
1355 char_u *arg = s + 7; | |
1356 int on = STRNCMP(arg, "on", 2) == 0 && arg + 2 == p; | |
1357 int off = STRNCMP(arg, "off", 3) == 0 && arg + 3 == p; | |
1358 int i; | |
1359 | |
1360 if (!on && !off) | |
1361 return FAIL; | |
1362 if (wp != NULL) | |
1363 { | |
1364 for (i = 0; i < 4; ++i) | |
1365 wp->w_popup_border[i] = on ? 1 : 0; | |
1366 if (off) | |
1367 // only show the X for close when there is a border | |
1368 wp->w_popup_close = POPCLOSE_NONE; | |
1351 } | 1369 } |
1352 } | 1370 } |
1353 else | 1371 else |
1354 return FAIL; | 1372 return FAIL; |
1355 } | 1373 } |