Mercurial > vim
comparison src/misc1.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 | 4dba3e4f3b01 |
children | 972ea22c946f |
comparison
equal
deleted
inserted
replaced
12476:2516383741e6 | 12477:68d7bc045dbe |
---|---|
1982 int lines; | 1982 int lines; |
1983 | 1983 |
1984 if (!wp->w_p_wrap) | 1984 if (!wp->w_p_wrap) |
1985 return 1; | 1985 return 1; |
1986 | 1986 |
1987 #ifdef FEAT_WINDOWS | |
1988 if (wp->w_width == 0) | 1987 if (wp->w_width == 0) |
1989 return 1; | 1988 return 1; |
1990 #endif | |
1991 | 1989 |
1992 #ifdef FEAT_FOLDING | 1990 #ifdef FEAT_FOLDING |
1993 /* A folded lines is handled just like an empty line. */ | 1991 /* A folded lines is handled just like an empty line. */ |
1994 /* NOTE: Caller must handle lines that are MAYBE folded. */ | 1992 /* NOTE: Caller must handle lines that are MAYBE folded. */ |
1995 if (lineFolded(wp, lnum) == TRUE) | 1993 if (lineFolded(wp, lnum) == TRUE) |
2058 #endif | 2056 #endif |
2059 | 2057 |
2060 if (!wp->w_p_wrap) | 2058 if (!wp->w_p_wrap) |
2061 return lines + 1; | 2059 return lines + 1; |
2062 | 2060 |
2063 #ifdef FEAT_WINDOWS | |
2064 if (wp->w_width == 0) | 2061 if (wp->w_width == 0) |
2065 return lines + 1; | 2062 return lines + 1; |
2066 #endif | |
2067 | 2063 |
2068 line = s = ml_get_buf(wp->w_buffer, lnum, FALSE); | 2064 line = s = ml_get_buf(wp->w_buffer, lnum, FALSE); |
2069 | 2065 |
2070 col = 0; | 2066 col = 0; |
2071 while (*s != NUL && --column >= 0) | 2067 while (*s != NUL && --column >= 0) |
2785 void | 2781 void |
2786 changed_int(void) | 2782 changed_int(void) |
2787 { | 2783 { |
2788 curbuf->b_changed = TRUE; | 2784 curbuf->b_changed = TRUE; |
2789 ml_setflags(curbuf); | 2785 ml_setflags(curbuf); |
2790 #ifdef FEAT_WINDOWS | |
2791 check_status(curbuf); | 2786 check_status(curbuf); |
2792 redraw_tabline = TRUE; | 2787 redraw_tabline = TRUE; |
2793 #endif | |
2794 #ifdef FEAT_TITLE | 2788 #ifdef FEAT_TITLE |
2795 need_maketitle = TRUE; /* set window title later */ | 2789 need_maketitle = TRUE; /* set window title later */ |
2796 #endif | 2790 #endif |
2797 } | 2791 } |
2798 | 2792 |
2993 colnr_T col, | 2987 colnr_T col, |
2994 linenr_T lnume, | 2988 linenr_T lnume, |
2995 long xtra) | 2989 long xtra) |
2996 { | 2990 { |
2997 win_T *wp; | 2991 win_T *wp; |
2998 #ifdef FEAT_WINDOWS | |
2999 tabpage_T *tp; | 2992 tabpage_T *tp; |
3000 #endif | |
3001 int i; | 2993 int i; |
3002 #ifdef FEAT_JUMPLIST | 2994 #ifdef FEAT_JUMPLIST |
3003 int cols; | 2995 int cols; |
3004 pos_T *p; | 2996 pos_T *p; |
3005 int add; | 2997 int add; |
3197 { | 3189 { |
3198 buf->b_changed = 0; | 3190 buf->b_changed = 0; |
3199 ml_setflags(buf); | 3191 ml_setflags(buf); |
3200 if (ff) | 3192 if (ff) |
3201 save_file_ff(buf); | 3193 save_file_ff(buf); |
3202 #ifdef FEAT_WINDOWS | |
3203 check_status(buf); | 3194 check_status(buf); |
3204 redraw_tabline = TRUE; | 3195 redraw_tabline = TRUE; |
3205 #endif | |
3206 #ifdef FEAT_TITLE | 3196 #ifdef FEAT_TITLE |
3207 need_maketitle = TRUE; /* set window title later */ | 3197 need_maketitle = TRUE; /* set window title later */ |
3208 #endif | 3198 #endif |
3209 } | 3199 } |
3210 ++CHANGEDTICK(buf); | 3200 ++CHANGEDTICK(buf); |
3211 #ifdef FEAT_NETBEANS_INTG | 3201 #ifdef FEAT_NETBEANS_INTG |
3212 netbeans_unmodified(buf); | 3202 netbeans_unmodified(buf); |
3213 #endif | 3203 #endif |
3214 } | 3204 } |
3215 | 3205 |
3216 #if defined(FEAT_WINDOWS) || defined(PROTO) | |
3217 /* | 3206 /* |
3218 * check_status: called when the status bars for the buffer 'buf' | 3207 * check_status: called when the status bars for the buffer 'buf' |
3219 * need to be updated | 3208 * need to be updated |
3220 */ | 3209 */ |
3221 void | 3210 void |
3229 wp->w_redr_status = TRUE; | 3218 wp->w_redr_status = TRUE; |
3230 if (must_redraw < VALID) | 3219 if (must_redraw < VALID) |
3231 must_redraw = VALID; | 3220 must_redraw = VALID; |
3232 } | 3221 } |
3233 } | 3222 } |
3234 #endif | |
3235 | 3223 |
3236 /* | 3224 /* |
3237 * If the file is readonly, give a warning message with the first change. | 3225 * If the file is readonly, give a warning message with the first change. |
3238 * Don't do this for autocommands. | 3226 * Don't do this for autocommands. |
3239 * Don't use emsg(), because it flushes the macro buffer. | 3227 * Don't use emsg(), because it flushes the macro buffer. |
5022 return (c == ';'); /* might not be right for every system... */ | 5010 return (c == ';'); /* might not be right for every system... */ |
5023 #endif | 5011 #endif |
5024 } | 5012 } |
5025 #endif | 5013 #endif |
5026 | 5014 |
5027 #if defined(FEAT_GUI_TABLINE) || defined(FEAT_WINDOWS) \ | |
5028 || defined(FEAT_EVAL) || defined(PROTO) | |
5029 /* | 5015 /* |
5030 * Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname" | 5016 * Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname" |
5031 * It's done in-place. | 5017 * It's done in-place. |
5032 */ | 5018 */ |
5033 void | 5019 void |
5066 } | 5052 } |
5067 # endif | 5053 # endif |
5068 } | 5054 } |
5069 } | 5055 } |
5070 } | 5056 } |
5071 #endif | |
5072 | 5057 |
5073 /* | 5058 /* |
5074 * Return TRUE if the directory of "fname" exists, FALSE otherwise. | 5059 * Return TRUE if the directory of "fname" exists, FALSE otherwise. |
5075 * Also returns TRUE if there is no directory name. | 5060 * Also returns TRUE if there is no directory name. |
5076 * "fname" must be writable!. | 5061 * "fname" must be writable!. |