comparison src/structs.h @ 12477:68d7bc045dbe v8.0.1118

patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 16 20:54:51 2017 +0200 patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always enabled and only adds 7% to the binary size of the tiny build. Solution: Graduate FEAT_WINDOWS.
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Sep 2017 21:00:06 +0200
parents d0cf7f71b95b
children 3f16cf18386c
comparison
equal deleted inserted replaced
12476:2516383741e6 12477:68d7bc045dbe
203 #define w_p_rnu w_onebuf_opt.wo_rnu /* 'relativenumber' */ 203 #define w_p_rnu w_onebuf_opt.wo_rnu /* 'relativenumber' */
204 #ifdef FEAT_LINEBREAK 204 #ifdef FEAT_LINEBREAK
205 long wo_nuw; 205 long wo_nuw;
206 # define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */ 206 # define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */
207 #endif 207 #endif
208 #if defined(FEAT_WINDOWS)
209 int wo_wfh; 208 int wo_wfh;
210 # define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */ 209 # define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */
211 int wo_wfw; 210 int wo_wfw;
212 # define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */ 211 # define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */
213 #endif 212 #if defined(FEAT_QUICKFIX)
214 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
215 int wo_pvw; 213 int wo_pvw;
216 # define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */ 214 # define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */
217 #endif 215 #endif
218 #ifdef FEAT_RIGHTLEFT 216 #ifdef FEAT_RIGHTLEFT
219 int wo_rl; 217 int wo_rl;
568 { 566 {
569 int hide; /* TRUE when ":hide" was used */ 567 int hide; /* TRUE when ":hide" was used */
570 # ifdef FEAT_BROWSE_CMD 568 # ifdef FEAT_BROWSE_CMD
571 int browse; /* TRUE to invoke file dialog */ 569 int browse; /* TRUE to invoke file dialog */
572 # endif 570 # endif
573 # ifdef FEAT_WINDOWS
574 int split; /* flags for win_split() */ 571 int split; /* flags for win_split() */
575 int tab; /* > 0 when ":tab" was used */ 572 int tab; /* > 0 when ":tab" was used */
576 # endif
577 # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 573 # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
578 int confirm; /* TRUE to invoke yes/no dialog */ 574 int confirm; /* TRUE to invoke yes/no dialog */
579 # endif 575 # endif
580 int keepalt; /* TRUE when ":keepalt" was used */ 576 int keepalt; /* TRUE when ":keepalt" was used */
581 int keepmarks; /* TRUE when ":keepmarks" was used */ 577 int keepmarks; /* TRUE when ":keepmarks" was used */
726 { 722 {
727 char_u *ae_fname; /* file name as specified */ 723 char_u *ae_fname; /* file name as specified */
728 int ae_fnum; /* buffer number with expanded file name */ 724 int ae_fnum; /* buffer number with expanded file name */
729 } aentry_T; 725 } aentry_T;
730 726
731 #ifdef FEAT_WINDOWS 727 #define ALIST(win) (win)->w_alist
732 # define ALIST(win) (win)->w_alist
733 #else
734 # define ALIST(win) (&global_alist)
735 #endif
736 #define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data) 728 #define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data)
737 #define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data) 729 #define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data)
738 #define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data) 730 #define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data)
739 #define AARGLIST(al) ((aentry_T *)((al)->al_ga.ga_data)) 731 #define AARGLIST(al) ((aentry_T *)((al)->al_ga.ga_data))
740 #define GARGCOUNT (global_alist.al_ga.ga_len) 732 #define GARGCOUNT (global_alist.al_ga.ga_len)
2529 * or row (FR_ROW) layout or is a leaf, which has a window. 2521 * or row (FR_ROW) layout or is a leaf, which has a window.
2530 */ 2522 */
2531 struct frame_S 2523 struct frame_S
2532 { 2524 {
2533 char fr_layout; /* FR_LEAF, FR_COL or FR_ROW */ 2525 char fr_layout; /* FR_LEAF, FR_COL or FR_ROW */
2534 #ifdef FEAT_WINDOWS
2535 int fr_width; 2526 int fr_width;
2536 int fr_newwidth; /* new width used in win_equal_rec() */ 2527 int fr_newwidth; /* new width used in win_equal_rec() */
2537 #endif
2538 int fr_height; 2528 int fr_height;
2539 int fr_newheight; /* new height used in win_equal_rec() */ 2529 int fr_newheight; /* new height used in win_equal_rec() */
2540 frame_T *fr_parent; /* containing frame or NULL */ 2530 frame_T *fr_parent; /* containing frame or NULL */
2541 frame_T *fr_next; /* frame right or below in same parent, NULL 2531 frame_T *fr_next; /* frame right or below in same parent, NULL
2542 for first */ 2532 for first */
2635 2625
2636 #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) 2626 #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
2637 synblock_T *w_s; /* for :ownsyntax */ 2627 synblock_T *w_s; /* for :ownsyntax */
2638 #endif 2628 #endif
2639 2629
2640 #ifdef FEAT_WINDOWS
2641 win_T *w_prev; /* link to previous window */ 2630 win_T *w_prev; /* link to previous window */
2642 win_T *w_next; /* link to next window */ 2631 win_T *w_next; /* link to next window */
2643 #endif
2644 #ifdef FEAT_AUTOCMD 2632 #ifdef FEAT_AUTOCMD
2645 int w_closing; /* window is being closed, don't let 2633 int w_closing; /* window is being closed, don't let
2646 autocommands close it too. */ 2634 autocommands close it too. */
2647 #endif 2635 #endif
2648 2636
2694 2682
2695 /* 2683 /*
2696 * Layout of the window in the screen. 2684 * Layout of the window in the screen.
2697 * May need to add "msg_scrolled" to "w_winrow" in rare situations. 2685 * May need to add "msg_scrolled" to "w_winrow" in rare situations.
2698 */ 2686 */
2699 #ifdef FEAT_WINDOWS
2700 int w_winrow; /* first row of window in screen */ 2687 int w_winrow; /* first row of window in screen */
2701 #endif
2702 int w_height; /* number of rows in window, excluding 2688 int w_height; /* number of rows in window, excluding
2703 status/command line(s) */ 2689 status/command line(s) */
2704 #ifdef FEAT_WINDOWS
2705 int w_status_height; /* number of status lines (0 or 1) */ 2690 int w_status_height; /* number of status lines (0 or 1) */
2706 int w_wincol; /* Leftmost column of window in screen. 2691 int w_wincol; /* Leftmost column of window in screen.
2707 use W_WINCOL() */ 2692 use W_WINCOL() */
2708 int w_width; /* Width of window, excluding separation. 2693 int w_width; /* Width of window, excluding separation.
2709 use W_WIDTH() */ 2694 use W_WIDTH() */
2710 int w_vsep_width; /* Number of separator columns (0 or 1). 2695 int w_vsep_width; /* Number of separator columns (0 or 1).
2711 use W_VSEP_WIDTH() */ 2696 use W_VSEP_WIDTH() */
2712 #endif
2713
2714 /* 2697 /*
2715 * === start of cached values ==== 2698 * === start of cached values ====
2716 */ 2699 */
2717 /* 2700 /*
2718 * Recomputing is minimized by storing the result of computations. 2701 * Recomputing is minimized by storing the result of computations.
2790 int w_redr_type; /* type of redraw to be performed on win */ 2773 int w_redr_type; /* type of redraw to be performed on win */
2791 int w_upd_rows; /* number of window lines to update when 2774 int w_upd_rows; /* number of window lines to update when
2792 w_redr_type is REDRAW_TOP */ 2775 w_redr_type is REDRAW_TOP */
2793 linenr_T w_redraw_top; /* when != 0: first line needing redraw */ 2776 linenr_T w_redraw_top; /* when != 0: first line needing redraw */
2794 linenr_T w_redraw_bot; /* when != 0: last line needing redraw */ 2777 linenr_T w_redraw_bot; /* when != 0: last line needing redraw */
2795 #ifdef FEAT_WINDOWS
2796 int w_redr_status; /* if TRUE status line must be redrawn */ 2778 int w_redr_status; /* if TRUE status line must be redrawn */
2797 #endif
2798 2779
2799 #ifdef FEAT_CMDL_INFO 2780 #ifdef FEAT_CMDL_INFO
2800 /* remember what is shown in the ruler for this window (if 'ruler' set) */ 2781 /* remember what is shown in the ruler for this window (if 'ruler' set) */
2801 pos_T w_ru_cursor; /* cursor position shown in ruler */ 2782 pos_T w_ru_cursor; /* cursor position shown in ruler */
2802 colnr_T w_ru_virtcol; /* virtcol shown in ruler */ 2783 colnr_T w_ru_virtcol; /* virtcol shown in ruler */
2808 char w_ru_empty; /* TRUE if ruler shows 0-1 (empty line) */ 2789 char w_ru_empty; /* TRUE if ruler shows 0-1 (empty line) */
2809 #endif 2790 #endif
2810 2791
2811 int w_alt_fnum; /* alternate file (for # and CTRL-^) */ 2792 int w_alt_fnum; /* alternate file (for # and CTRL-^) */
2812 2793
2813 #ifdef FEAT_WINDOWS
2814 alist_T *w_alist; /* pointer to arglist for this window */ 2794 alist_T *w_alist; /* pointer to arglist for this window */
2815 #endif
2816 int w_arg_idx; /* current index in argument list (can be 2795 int w_arg_idx; /* current index in argument list (can be
2817 out of range!) */ 2796 out of range!) */
2818 int w_arg_idx_invalid; /* editing another file than w_arg_idx */ 2797 int w_arg_idx_invalid; /* editing another file than w_arg_idx */
2819 2798
2820 char_u *w_localdir; /* absolute path of local directory or 2799 char_u *w_localdir; /* absolute path of local directory or
3344 #endif 3323 #endif
3345 int no_swap_file; /* "-n" argument used */ 3324 int no_swap_file; /* "-n" argument used */
3346 #ifdef FEAT_EVAL 3325 #ifdef FEAT_EVAL
3347 int use_debug_break_level; 3326 int use_debug_break_level;
3348 #endif 3327 #endif
3349 #ifdef FEAT_WINDOWS
3350 int window_count; /* number of windows to use */ 3328 int window_count; /* number of windows to use */
3351 int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */ 3329 int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */
3352 #endif
3353 3330
3354 #ifdef FEAT_CLIENTSERVER 3331 #ifdef FEAT_CLIENTSERVER
3355 int serverArg; /* TRUE when argument for a server */ 3332 int serverArg; /* TRUE when argument for a server */
3356 char_u *serverName_arg; /* cmdline arg for server name */ 3333 char_u *serverName_arg; /* cmdline arg for server name */
3357 char_u *serverStr; /* remote server command */ 3334 char_u *serverStr; /* remote server command */