comparison src/popupwin.c @ 19267:c7903f92ed75 v8.2.0192

patch 8.2.0192: build failure without +terminal feature Commit: https://github.com/vim/vim/commit/91cd59a0a20b944f703ca65e67f2e637fbb7e812 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 1 22:18:37 2020 +0100 patch 8.2.0192: build failure without +terminal feature Problem: Build failure without +terminal feature. Solution: Add #ifdefs.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Feb 2020 22:30:03 +0100
parents ce8c47ed54e5
children ebeeb4b4a1fa
comparison
equal deleted inserted replaced
19266:4bb646771aef 19267:c7903f92ed75
2027 wp->w_vsep_width = 0; 2027 wp->w_vsep_width = 0;
2028 2028
2029 redraw_all_later(NOT_VALID); 2029 redraw_all_later(NOT_VALID);
2030 popup_mask_refresh = TRUE; 2030 popup_mask_refresh = TRUE;
2031 2031
2032 #ifdef FEAT_TERMINAL
2032 // When running a terminal in the popup it becomes the current window. 2033 // When running a terminal in the popup it becomes the current window.
2033 if (buf->b_term != NULL) 2034 if (buf->b_term != NULL)
2034 win_enter(wp, FALSE); 2035 win_enter(wp, FALSE);
2036 #endif
2035 2037
2036 return wp; 2038 return wp;
2037 } 2039 }
2038 2040
2039 /* 2041 /*
2107 static void 2109 static void
2108 popup_close_and_callback(win_T *wp, typval_T *arg) 2110 popup_close_and_callback(win_T *wp, typval_T *arg)
2109 { 2111 {
2110 int id = wp->w_id; 2112 int id = wp->w_id;
2111 2113
2114 #ifdef FEAT_TERMINAL
2112 if (wp == curwin && curbuf->b_term != NULL) 2115 if (wp == curwin && curbuf->b_term != NULL)
2113 { 2116 {
2114 // Closing popup window with a terminal: put focus back on the previous 2117 // Closing popup window with a terminal: put focus back on the previous
2115 // window. 2118 // window.
2116 win_enter(prevwin, FALSE); 2119 win_enter(prevwin, FALSE);
2117 } 2120 }
2121 #endif
2118 2122
2119 // Just in case a check higher up is missing. 2123 // Just in case a check higher up is missing.
2120 if (wp == curwin && ERROR_IF_POPUP_WINDOW) 2124 if (wp == curwin && ERROR_IF_POPUP_WINDOW)
2121 return; 2125 return;
2122 2126
2844 error_if_popup_window() 2848 error_if_popup_window()
2845 { 2849 {
2846 // win_execute() may set "curwin" to a popup window temporarily, but many 2850 // win_execute() may set "curwin" to a popup window temporarily, but many
2847 // commands are disallowed then. When a terminal runs in the popup most 2851 // commands are disallowed then. When a terminal runs in the popup most
2848 // things are allowed. 2852 // things are allowed.
2849 if (WIN_IS_POPUP(curwin) && curbuf->b_term == NULL) 2853 if (WIN_IS_POPUP(curwin)
2854 # ifdef FEAT_TERMINAL
2855 && curbuf->b_term == NULL
2856 # endif
2857 )
2850 { 2858 {
2851 emsg(_("E994: Not allowed in a popup window")); 2859 emsg(_("E994: Not allowed in a popup window"));
2852 return TRUE; 2860 return TRUE;
2853 } 2861 }
2854 return FALSE; 2862 return FALSE;
2855 } 2863 }
2856 2864
2865 # if defined(FEAT_TERMINAL) || defined(PROTO)
2857 int 2866 int
2858 error_if_term_popup_window() 2867 error_if_term_popup_window()
2859 { 2868 {
2860 if (WIN_IS_POPUP(curwin) && curbuf->b_term != NULL) 2869 if (WIN_IS_POPUP(curwin) && curbuf->b_term != NULL)
2861 { 2870 {
2862 emsg(_("E899: Not allowed for a terminal in a popup window")); 2871 emsg(_("E899: Not allowed for a terminal in a popup window"));
2863 return TRUE; 2872 return TRUE;
2864 } 2873 }
2865 return FALSE; 2874 return FALSE;
2866 } 2875 }
2876 # endif
2867 2877
2868 /* 2878 /*
2869 * Reset all the "handled_flag" flags in global popup windows and popup windows 2879 * Reset all the "handled_flag" flags in global popup windows and popup windows
2870 * in the current tab page. 2880 * in the current tab page.
2871 * Each calling function should use a different flag, see the list at 2881 * Each calling function should use a different flag, see the list at
2982 win_T *wp; 2992 win_T *wp;
2983 int save_KeyTyped = KeyTyped; 2993 int save_KeyTyped = KeyTyped;
2984 int state; 2994 int state;
2985 int was_must_redraw = must_redraw; 2995 int was_must_redraw = must_redraw;
2986 2996
2997 #ifdef FEAT_TERMINAL
2987 // Popup window with terminal always gets focus. 2998 // Popup window with terminal always gets focus.
2988 if (popup_is_popup(curwin) && curbuf->b_term != NULL) 2999 if (popup_is_popup(curwin) && curbuf->b_term != NULL)
2989 return FALSE; 3000 return FALSE;
3001 #endif
2990 3002
2991 if (recursive) 3003 if (recursive)
2992 return FALSE; 3004 return FALSE;
2993 recursive = TRUE; 3005 recursive = TRUE;
2994 3006