comparison src/term.c @ 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 269d3cdc1214
children 93a849230c1c
comparison
equal deleted inserted replaced
12476:2516383741e6 12477:68d7bc045dbe
194 # endif 194 # endif
195 {(int)KS_DL, IF_EB("\033|d", ESC_STR "|d")}, 195 {(int)KS_DL, IF_EB("\033|d", ESC_STR "|d")},
196 # ifdef TERMINFO 196 # ifdef TERMINFO
197 {(int)KS_CDL, IF_EB("\033|%p1%dD", ESC_STR "|%p1%dD")}, 197 {(int)KS_CDL, IF_EB("\033|%p1%dD", ESC_STR "|%p1%dD")},
198 {(int)KS_CS, IF_EB("\033|%p1%d;%p2%dR", ESC_STR "|%p1%d;%p2%dR")}, 198 {(int)KS_CS, IF_EB("\033|%p1%d;%p2%dR", ESC_STR "|%p1%d;%p2%dR")},
199 # ifdef FEAT_WINDOWS
200 {(int)KS_CSV, IF_EB("\033|%p1%d;%p2%dV", ESC_STR "|%p1%d;%p2%dV")}, 199 {(int)KS_CSV, IF_EB("\033|%p1%d;%p2%dV", ESC_STR "|%p1%d;%p2%dV")},
201 # endif
202 # else 200 # else
203 {(int)KS_CDL, IF_EB("\033|%dD", ESC_STR "|%dD")}, 201 {(int)KS_CDL, IF_EB("\033|%dD", ESC_STR "|%dD")},
204 {(int)KS_CS, IF_EB("\033|%d;%dR", ESC_STR "|%d;%dR")}, 202 {(int)KS_CS, IF_EB("\033|%d;%dR", ESC_STR "|%d;%dR")},
205 # ifdef FEAT_WINDOWS
206 {(int)KS_CSV, IF_EB("\033|%d;%dV", ESC_STR "|%d;%dV")}, 203 {(int)KS_CSV, IF_EB("\033|%d;%dV", ESC_STR "|%d;%dV")},
207 # endif
208 # endif 204 # endif
209 {(int)KS_CL, IF_EB("\033|C", ESC_STR "|C")}, 205 {(int)KS_CL, IF_EB("\033|C", ESC_STR "|C")},
210 /* attributes switched on with 'h', off with * 'H' */ 206 /* attributes switched on with 'h', off with * 'H' */
211 {(int)KS_ME, IF_EB("\033|31H", ESC_STR "|31H")}, /* HL_ALL */ 207 {(int)KS_ME, IF_EB("\033|31H", ESC_STR "|31H")}, /* HL_ALL */
212 {(int)KS_MR, IF_EB("\033|1h", ESC_STR "|1h")}, /* HL_INVERSE */ 208 {(int)KS_MR, IF_EB("\033|1h", ESC_STR "|1h")}, /* HL_INVERSE */
1119 # ifdef TERMINFO 1115 # ifdef TERMINFO
1120 {(int)KS_CS, "[%p1%dCS%p2%d]"}, 1116 {(int)KS_CS, "[%p1%dCS%p2%d]"},
1121 # else 1117 # else
1122 {(int)KS_CS, "[%dCS%d]"}, 1118 {(int)KS_CS, "[%dCS%d]"},
1123 # endif 1119 # endif
1124 # ifdef FEAT_WINDOWS 1120 # ifdef TERMINFO
1125 # ifdef TERMINFO
1126 {(int)KS_CSV, "[%p1%dCSV%p2%d]"}, 1121 {(int)KS_CSV, "[%p1%dCSV%p2%d]"},
1127 # else 1122 # else
1128 {(int)KS_CSV, "[%dCSV%d]"}, 1123 {(int)KS_CSV, "[%dCSV%d]"},
1129 # endif
1130 # endif 1124 # endif
1131 # ifdef TERMINFO 1125 # ifdef TERMINFO
1132 {(int)KS_CAB, "[CAB%p1%d]"}, 1126 {(int)KS_CAB, "[CAB%p1%d]"},
1133 {(int)KS_CAF, "[CAF%p1%d]"}, 1127 {(int)KS_CAF, "[CAF%p1%d]"},
1134 {(int)KS_CSB, "[CSB%p1%d]"}, 1128 {(int)KS_CSB, "[CSB%p1%d]"},
3132 shell_new_rows(); /* update window sizes */ 3126 shell_new_rows(); /* update window sizes */
3133 } 3127 }
3134 if (old_Columns != Columns) 3128 if (old_Columns != Columns)
3135 { 3129 {
3136 old_Columns = Columns; 3130 old_Columns = Columns;
3137 #ifdef FEAT_WINDOWS
3138 shell_new_columns(); /* update window sizes */ 3131 shell_new_columns(); /* update window sizes */
3139 #endif
3140 } 3132 }
3141 } 3133 }
3142 3134
3143 /* 3135 /*
3144 * Call this function when the Vim shell has been resized in any way. 3136 * Call this function when the Vim shell has been resized in any way.
3821 void 3813 void
3822 scroll_region_set(win_T *wp, int off) 3814 scroll_region_set(win_T *wp, int off)
3823 { 3815 {
3824 OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1, 3816 OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1,
3825 W_WINROW(wp) + off)); 3817 W_WINROW(wp) + off));
3826 #ifdef FEAT_WINDOWS
3827 if (*T_CSV != NUL && wp->w_width != Columns) 3818 if (*T_CSV != NUL && wp->w_width != Columns)
3828 OUT_STR(tgoto((char *)T_CSV, W_WINCOL(wp) + wp->w_width - 1, 3819 OUT_STR(tgoto((char *)T_CSV, W_WINCOL(wp) + wp->w_width - 1,
3829 W_WINCOL(wp))); 3820 W_WINCOL(wp)));
3830 #endif
3831 screen_start(); /* don't know where cursor is now */ 3821 screen_start(); /* don't know where cursor is now */
3832 } 3822 }
3833 3823
3834 /* 3824 /*
3835 * Reset scrolling region to the whole screen. 3825 * Reset scrolling region to the whole screen.
3836 */ 3826 */
3837 void 3827 void
3838 scroll_region_reset(void) 3828 scroll_region_reset(void)
3839 { 3829 {
3840 OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0)); 3830 OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0));
3841 #ifdef FEAT_WINDOWS
3842 if (*T_CSV != NUL) 3831 if (*T_CSV != NUL)
3843 OUT_STR(tgoto((char *)T_CSV, (int)Columns - 1, 0)); 3832 OUT_STR(tgoto((char *)T_CSV, (int)Columns - 1, 0));
3844 #endif
3845 screen_start(); /* don't know where cursor is now */ 3833 screen_start(); /* don't know where cursor is now */
3846 } 3834 }
3847 3835
3848 3836
3849 /* 3837 /*
4118 static linenr_T orig_topline = 0; 4106 static linenr_T orig_topline = 0;
4119 # ifdef FEAT_DIFF 4107 # ifdef FEAT_DIFF
4120 static int orig_topfill = 0; 4108 static int orig_topfill = 0;
4121 # endif 4109 # endif
4122 #endif 4110 #endif
4123 #if (defined(FEAT_WINDOWS) && defined(CHECK_DOUBLE_CLICK)) || defined(PROTO) 4111 #if defined(CHECK_DOUBLE_CLICK) || defined(PROTO)
4124 /* 4112 /*
4125 * Checking for double clicks ourselves. 4113 * Checking for double clicks ourselves.
4126 * "orig_topline" is used to avoid detecting a double-click when the window 4114 * "orig_topline" is used to avoid detecting a double-click when the window
4127 * contents scrolled (e.g., when 'scrolloff' is non-zero). 4115 * contents scrolled (e.g., when 'scrolloff' is non-zero).
4128 */ 4116 */
5505 && ((orig_topline == curwin->w_topline 5493 && ((orig_topline == curwin->w_topline
5506 #ifdef FEAT_DIFF 5494 #ifdef FEAT_DIFF
5507 && orig_topfill == curwin->w_topfill 5495 && orig_topfill == curwin->w_topfill
5508 #endif 5496 #endif
5509 ) 5497 )
5510 #ifdef FEAT_WINDOWS
5511 /* Double click in tab pages line also works 5498 /* Double click in tab pages line also works
5512 * when window contents changes. */ 5499 * when window contents changes. */
5513 || (mouse_row == 0 && firstwin->w_winrow > 0) 5500 || (mouse_row == 0 && firstwin->w_winrow > 0))
5514 #endif
5515 )
5516 ) 5501 )
5517 ++orig_num_clicks; 5502 ++orig_num_clicks;
5518 else 5503 else
5519 orig_num_clicks = 1; 5504 orig_num_clicks = 1;
5520 orig_mouse_col = mouse_col; 5505 orig_mouse_col = mouse_col;