Mercurial > vim
comparison src/popupwin.c @ 18767:068337e86133 v8.1.2373
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Commit: https://github.com/vim/vim/commit/5a4c3082d7ab51b3d448a91578479c96c1ab0ad3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 1 15:23:11 2019 +0100
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Problem: Cannot build with +popupwin but without +quickfix. (John Marriott)
Solution: Adjust #ifdefs.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Dec 2019 15:30:04 +0100 |
parents | 49b78d6465e5 |
children | 5fbb167591fc |
comparison
equal
deleted
inserted
replaced
18766:3cc0ddf2abd0 | 18767:068337e86133 |
---|---|
2384 win_T *wp = find_popup_win(id); | 2384 win_T *wp = find_popup_win(id); |
2385 | 2385 |
2386 if (wp != NULL) | 2386 if (wp != NULL) |
2387 { | 2387 { |
2388 popup_show(wp); | 2388 popup_show(wp); |
2389 #ifdef FEAT_QUICKFIX | |
2389 if (wp->w_popup_flags & POPF_INFO) | 2390 if (wp->w_popup_flags & POPF_INFO) |
2390 pum_position_info_popup(wp); | 2391 pum_position_info_popup(wp); |
2392 #endif | |
2391 } | 2393 } |
2392 } | 2394 } |
2393 | 2395 |
2394 /* | 2396 /* |
2395 * popup_settext({id}, {text}) | 2397 * popup_settext({id}, {text}) |
3684 break; | 3686 break; |
3685 } | 3687 } |
3686 return abort; | 3688 return abort; |
3687 } | 3689 } |
3688 | 3690 |
3691 int | |
3692 popup_is_popup(win_T *wp) | |
3693 { | |
3694 return wp->w_popup_flags != 0; | |
3695 } | |
3696 | |
3697 #if defined(FEAT_QUICKFIX) || defined(PROTO) | |
3689 /* | 3698 /* |
3690 * Find an existing popup used as the preview window, in the current tab page. | 3699 * Find an existing popup used as the preview window, in the current tab page. |
3691 * Return NULL if not found. | 3700 * Return NULL if not found. |
3692 */ | 3701 */ |
3693 win_T * | 3702 win_T * |
3700 if (wp->w_p_pvw) | 3709 if (wp->w_p_pvw) |
3701 return wp; | 3710 return wp; |
3702 return NULL; | 3711 return NULL; |
3703 } | 3712 } |
3704 | 3713 |
3705 int | |
3706 popup_is_popup(win_T *wp) | |
3707 { | |
3708 return wp->w_popup_flags != 0; | |
3709 } | |
3710 | |
3711 #if defined(FEAT_QUICKFIX) || defined(PROTO) | |
3712 /* | 3714 /* |
3713 * Find an existing popup used as the info window, in the current tab page. | 3715 * Find an existing popup used as the info window, in the current tab page. |
3714 * Return NULL if not found. | 3716 * Return NULL if not found. |
3715 */ | 3717 */ |
3716 win_T * | 3718 win_T * |
3727 #endif | 3729 #endif |
3728 | 3730 |
3729 void | 3731 void |
3730 f_popup_findinfo(typval_T *argvars UNUSED, typval_T *rettv) | 3732 f_popup_findinfo(typval_T *argvars UNUSED, typval_T *rettv) |
3731 { | 3733 { |
3734 #ifdef FEAT_QUICKFIX | |
3732 win_T *wp = popup_find_info_window(); | 3735 win_T *wp = popup_find_info_window(); |
3733 | 3736 |
3734 rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; | 3737 rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; |
3738 #else | |
3739 rettv->vval.v_number = 0; | |
3740 #endif | |
3735 } | 3741 } |
3736 | 3742 |
3737 void | 3743 void |
3738 f_popup_findpreview(typval_T *argvars UNUSED, typval_T *rettv) | 3744 f_popup_findpreview(typval_T *argvars UNUSED, typval_T *rettv) |
3739 { | 3745 { |
3746 #ifdef FEAT_QUICKFIX | |
3740 win_T *wp = popup_find_preview_window(); | 3747 win_T *wp = popup_find_preview_window(); |
3741 | 3748 |
3742 rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; | 3749 rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; |
3743 } | 3750 #else |
3744 | 3751 rettv->vval.v_number = 0; |
3752 #endif | |
3753 } | |
3754 | |
3755 #if defined(FEAT_QUICKFIX) || defined(PROTO) | |
3745 /* | 3756 /* |
3746 * Create a popup to be used as the preview or info window. | 3757 * Create a popup to be used as the preview or info window. |
3747 * NOTE: this makes the popup the current window, so that the file can be | 3758 * NOTE: this makes the popup the current window, so that the file can be |
3748 * edited. However, it must not remain to be the current window, the caller | 3759 * edited. However, it must not remain to be the current window, the caller |
3749 * must make sure of that. | 3760 * must make sure of that. |
3773 | 3784 |
3774 win_enter(wp, FALSE); | 3785 win_enter(wp, FALSE); |
3775 return OK; | 3786 return OK; |
3776 } | 3787 } |
3777 | 3788 |
3778 #if defined(FEAT_QUICKFIX) || defined(PROTO) | |
3779 /* | 3789 /* |
3780 * Close any preview popup. | 3790 * Close any preview popup. |
3781 */ | 3791 */ |
3782 void | 3792 void |
3783 popup_close_preview(void) | 3793 popup_close_preview(void) |
3849 wp->w_buffer->b_fname); | 3859 wp->w_buffer->b_fname); |
3850 redraw_win_later(wp, VALID); | 3860 redraw_win_later(wp, VALID); |
3851 } | 3861 } |
3852 } | 3862 } |
3853 | 3863 |
3864 # if defined(FEAT_QUICKFIX) || defined(PROTO) | |
3854 /* | 3865 /* |
3855 * If there is a preview window, update the title. | 3866 * If there is a preview window, update the title. |
3856 * Used after changing directory. | 3867 * Used after changing directory. |
3857 */ | 3868 */ |
3858 void | 3869 void |
3861 win_T *wp = popup_find_preview_window(); | 3872 win_T *wp = popup_find_preview_window(); |
3862 | 3873 |
3863 if (wp != NULL) | 3874 if (wp != NULL) |
3864 popup_set_title(wp); | 3875 popup_set_title(wp); |
3865 } | 3876 } |
3877 # endif | |
3866 | 3878 |
3867 #endif // FEAT_PROP_POPUP | 3879 #endif // FEAT_PROP_POPUP |