comparison src/popupwin.c @ 17791:55c167b08c2b v8.1.1892

patch 8.1.1892: missing index entry and option menu for 'completepopup' commit https://github.com/vim/vim/commit/36e4d985f0e015b189351d612132d382da9d014d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 20 21:12:16 2019 +0200 patch 8.1.1892: missing index entry and option menu for 'completepopup' Problem: Missing index entry and option menu for 'completepopup'. Solution: Add the entries. Adjust #ifdefs to avoid dead code.
author Bram Moolenaar <Bram@vim.org>
date Tue, 20 Aug 2019 21:15:04 +0200
parents 0f7ae8010787
children b5499bf22a97
comparison
equal deleted inserted replaced
17790:c6a0db4bab28 17791:55c167b08c2b
1292 * Return FAIL if the parsing fails. 1292 * Return FAIL if the parsing fails.
1293 */ 1293 */
1294 static int 1294 static int
1295 parse_popup_option(win_T *wp, int is_preview) 1295 parse_popup_option(win_T *wp, int is_preview)
1296 { 1296 {
1297 char_u *p; 1297 char_u *p =
1298 1298 #ifdef FEAT_QUICKFIX
1299 for (p = is_preview ? p_pvp : p_cpp; *p != NUL; p += (*p == ',' ? 1 : 0)) 1299 !is_preview ? p_cpp :
1300 #endif
1301 p_pvp;
1302
1303 for ( ; *p != NUL; p += (*p == ',' ? 1 : 0))
1300 { 1304 {
1301 char_u *e, *dig; 1305 char_u *e, *dig;
1302 char_u *s = p; 1306 char_u *s = p;
1303 int x; 1307 int x;
1304 1308
1672 for (i = 0; i < 4; ++i) 1676 for (i = 0; i < 4; ++i)
1673 wp->w_popup_border[i] = 1; 1677 wp->w_popup_border[i] = 1;
1674 parse_previewpopup(wp); 1678 parse_previewpopup(wp);
1675 popup_set_wantpos_cursor(wp, wp->w_minwidth); 1679 popup_set_wantpos_cursor(wp, wp->w_minwidth);
1676 } 1680 }
1681 # ifdef FEAT_QUICKFIX
1677 if (type == TYPE_INFO) 1682 if (type == TYPE_INFO)
1678 { 1683 {
1679 wp->w_popup_pos = POPPOS_TOPLEFT; 1684 wp->w_popup_pos = POPPOS_TOPLEFT;
1680 wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE; 1685 wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE;
1681 wp->w_popup_close = POPCLOSE_BUTTON; 1686 wp->w_popup_close = POPCLOSE_BUTTON;
1682 add_border_left_right_padding(wp); 1687 add_border_left_right_padding(wp);
1683 parse_completepopup(wp); 1688 parse_completepopup(wp);
1684 } 1689 }
1690 # endif
1685 1691
1686 for (i = 0; i < 4; ++i) 1692 for (i = 0; i < 4; ++i)
1687 VIM_CLEAR(wp->w_border_highlight[i]); 1693 VIM_CLEAR(wp->w_border_highlight[i]);
1688 for (i = 0; i < 8; ++i) 1694 for (i = 0; i < 8; ++i)
1689 wp->w_border_char[i] = 0; 1695 wp->w_border_char[i] = 0;
3255 popup_is_popup(win_T *wp) 3261 popup_is_popup(win_T *wp)
3256 { 3262 {
3257 return wp->w_popup_flags != 0; 3263 return wp->w_popup_flags != 0;
3258 } 3264 }
3259 3265
3266 #if defined(FEAT_QUICKFIX) || defined(PROTO)
3260 /* 3267 /*
3261 * Find an existing popup used as the info window, in the current tab page. 3268 * Find an existing popup used as the info window, in the current tab page.
3262 * Return NULL if not found. 3269 * Return NULL if not found.
3263 */ 3270 */
3264 win_T * 3271 win_T *
3270 for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next) 3277 for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
3271 if (wp->w_popup_flags & POPF_INFO) 3278 if (wp->w_popup_flags & POPF_INFO)
3272 return wp; 3279 return wp;
3273 return NULL; 3280 return NULL;
3274 } 3281 }
3282 #endif
3275 3283
3276 void 3284 void
3277 f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv) 3285 f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv)
3278 { 3286 {
3279 win_T *wp = popup_find_preview_window(); 3287 win_T *wp = popup_find_preview_window();
3312 3320
3313 win_enter(wp, FALSE); 3321 win_enter(wp, FALSE);
3314 return OK; 3322 return OK;
3315 } 3323 }
3316 3324
3325 #if defined(FEAT_QUICKFIX) || defined(PROTO)
3317 void 3326 void
3318 popup_close_preview(int info) 3327 popup_close_preview(int info)
3319 { 3328 {
3320 win_T *wp = info ? popup_find_info_window() : popup_find_preview_window(); 3329 win_T *wp = info ? popup_find_info_window() : popup_find_preview_window();
3321 3330
3326 res.v_type = VAR_NUMBER; 3335 res.v_type = VAR_NUMBER;
3327 res.vval.v_number = -1; 3336 res.vval.v_number = -1;
3328 popup_close_and_callback(wp, &res); 3337 popup_close_and_callback(wp, &res);
3329 } 3338 }
3330 } 3339 }
3340 #endif
3331 3341
3332 /* 3342 /*
3333 * Set the title of the popup window to the file name. 3343 * Set the title of the popup window to the file name.
3334 */ 3344 */
3335 void 3345 void