Mercurial > vim
comparison src/globals.h @ 17592:3e46860fd4c9 v8.1.1793
patch 8.1.1793: mixed comment style in globals
commit https://github.com/vim/vim/commit/1ccaa35abf0706de3516b3013fe12964abada079
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 2 22:08:25 2019 +0200
patch 8.1.1793: mixed comment style in globals
Problem: Mixed comment style in globals.
Solution: Use // comments where appropriate.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Aug 2019 22:15:04 +0200 |
parents | dfd87ef822aa |
children | e259d11e2900 |
comparison
equal
deleted
inserted
replaced
17591:b0ff642a241b | 17592:3e46860fd4c9 |
---|---|
15 * Must be long to be able to use them as options in option.c. | 15 * Must be long to be able to use them as options in option.c. |
16 * Note: Use screen_Rows and screen_Columns to access items in ScreenLines[]. | 16 * Note: Use screen_Rows and screen_Columns to access items in ScreenLines[]. |
17 * They may have different values when the screen wasn't (re)allocated yet | 17 * They may have different values when the screen wasn't (re)allocated yet |
18 * after setting Rows or Columns (e.g., when starting up). | 18 * after setting Rows or Columns (e.g., when starting up). |
19 */ | 19 */ |
20 EXTERN long Rows /* nr of rows in the screen */ | 20 EXTERN long Rows // nr of rows in the screen |
21 #ifdef DO_INIT | 21 #ifdef DO_INIT |
22 # if defined(MSWIN) | 22 # if defined(MSWIN) |
23 = 25L | 23 = 25L |
24 # else | 24 # else |
25 = 24L | 25 = 24L |
26 # endif | 26 # endif |
27 #endif | 27 #endif |
28 ; | 28 ; |
29 EXTERN long Columns INIT(= 80); /* nr of columns in the screen */ | 29 EXTERN long Columns INIT(= 80); // nr of columns in the screen |
30 | 30 |
31 /* | 31 /* |
32 * The characters that are currently on the screen are kept in ScreenLines[]. | 32 * The characters that are currently on the screen are kept in ScreenLines[]. |
33 * It is a single block of characters, the size of the screen plus one line. | 33 * It is a single block of characters, the size of the screen plus one line. |
34 * The attributes for those characters are kept in ScreenAttrs[]. | 34 * The attributes for those characters are kept in ScreenAttrs[]. |
40 * NULL. | 40 * NULL. |
41 */ | 41 */ |
42 EXTERN schar_T *ScreenLines INIT(= NULL); | 42 EXTERN schar_T *ScreenLines INIT(= NULL); |
43 EXTERN sattr_T *ScreenAttrs INIT(= NULL); | 43 EXTERN sattr_T *ScreenAttrs INIT(= NULL); |
44 EXTERN unsigned *LineOffset INIT(= NULL); | 44 EXTERN unsigned *LineOffset INIT(= NULL); |
45 EXTERN char_u *LineWraps INIT(= NULL); /* line wraps to next line */ | 45 EXTERN char_u *LineWraps INIT(= NULL); // line wraps to next line |
46 | 46 |
47 /* | 47 /* |
48 * When using Unicode characters (in UTF-8 encoding) the character in | 48 * When using Unicode characters (in UTF-8 encoding) the character in |
49 * ScreenLinesUC[] contains the Unicode for the character at this position, or | 49 * ScreenLinesUC[] contains the Unicode for the character at this position, or |
50 * NUL when the character in ScreenLines[] is to be used (ASCII char). | 50 * NUL when the character in ScreenLines[] is to be used (ASCII char). |
51 * The composing characters are to be drawn on top of the original character. | 51 * The composing characters are to be drawn on top of the original character. |
52 * ScreenLinesC[0][off] is only to be used when ScreenLinesUC[off] != 0. | 52 * ScreenLinesC[0][off] is only to be used when ScreenLinesUC[off] != 0. |
53 * Note: These three are only allocated when enc_utf8 is set! | 53 * Note: These three are only allocated when enc_utf8 is set! |
54 */ | 54 */ |
55 EXTERN u8char_T *ScreenLinesUC INIT(= NULL); /* decoded UTF-8 characters */ | 55 EXTERN u8char_T *ScreenLinesUC INIT(= NULL); // decoded UTF-8 characters |
56 EXTERN u8char_T *ScreenLinesC[MAX_MCO]; /* composing characters */ | 56 EXTERN u8char_T *ScreenLinesC[MAX_MCO]; // composing characters |
57 EXTERN int Screen_mco INIT(= 0); /* value of p_mco used when | 57 EXTERN int Screen_mco INIT(= 0); // value of p_mco used when |
58 allocating ScreenLinesC[] */ | 58 // allocating ScreenLinesC[] |
59 | 59 |
60 /* Only used for euc-jp: Second byte of a character that starts with 0x8e. | 60 // Only used for euc-jp: Second byte of a character that starts with 0x8e. |
61 * These are single-width. */ | 61 // These are single-width. |
62 EXTERN schar_T *ScreenLines2 INIT(= NULL); | 62 EXTERN schar_T *ScreenLines2 INIT(= NULL); |
63 | 63 |
64 /* | 64 /* |
65 * Indexes for tab page line: | 65 * Indexes for tab page line: |
66 * N > 0 for label of tab page N | 66 * N > 0 for label of tab page N |
86 // Zindex in for screen_char(): if lower than the value in "popup_mask" | 86 // Zindex in for screen_char(): if lower than the value in "popup_mask" |
87 // drawing the character is skipped. | 87 // drawing the character is skipped. |
88 EXTERN int screen_zindex INIT(= 0); | 88 EXTERN int screen_zindex INIT(= 0); |
89 #endif | 89 #endif |
90 | 90 |
91 EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */ | 91 EXTERN int screen_Rows INIT(= 0); // actual size of ScreenLines[] |
92 EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */ | 92 EXTERN int screen_Columns INIT(= 0); // actual size of ScreenLines[] |
93 | 93 |
94 /* | 94 /* |
95 * When vgetc() is called, it sets mod_mask to the set of modifiers that are | 95 * When vgetc() is called, it sets mod_mask to the set of modifiers that are |
96 * held down based on the MOD_MASK_* symbols that are read first. | 96 * held down based on the MOD_MASK_* symbols that are read first. |
97 */ | 97 */ |
98 EXTERN int mod_mask INIT(= 0x0); /* current key modifiers */ | 98 EXTERN int mod_mask INIT(= 0x0); // current key modifiers |
99 | 99 |
100 /* | 100 /* |
101 * Cmdline_row is the row where the command line starts, just below the | 101 * Cmdline_row is the row where the command line starts, just below the |
102 * last window. | 102 * last window. |
103 * When the cmdline gets longer than the available space the screen gets | 103 * When the cmdline gets longer than the available space the screen gets |
115 EXTERN int no_win_do_lines_ins INIT(= FALSE); // don't insert lines | 115 EXTERN int no_win_do_lines_ins INIT(= FALSE); // don't insert lines |
116 #if defined(FEAT_CRYPT) || defined(FEAT_EVAL) | 116 #if defined(FEAT_CRYPT) || defined(FEAT_EVAL) |
117 EXTERN int cmdline_star INIT(= FALSE); // cmdline is crypted | 117 EXTERN int cmdline_star INIT(= FALSE); // cmdline is crypted |
118 #endif | 118 #endif |
119 | 119 |
120 EXTERN int exec_from_reg INIT(= FALSE); /* executing register */ | 120 EXTERN int exec_from_reg INIT(= FALSE); // executing register |
121 | 121 |
122 EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */ | 122 EXTERN int screen_cleared INIT(= FALSE); // screen has been cleared |
123 | 123 |
124 /* | 124 /* |
125 * When '$' is included in 'cpoptions' option set: | 125 * When '$' is included in 'cpoptions' option set: |
126 * When a change command is given that deletes only part of a line, a dollar | 126 * When a change command is given that deletes only part of a line, a dollar |
127 * is put at the end of the changed text. dollar_vcol is set to the virtual | 127 * is put at the end of the changed text. dollar_vcol is set to the virtual |
132 #ifdef FEAT_INS_EXPAND | 132 #ifdef FEAT_INS_EXPAND |
133 /* | 133 /* |
134 * Variables for Insert mode completion. | 134 * Variables for Insert mode completion. |
135 */ | 135 */ |
136 | 136 |
137 /* Length in bytes of the text being completed (this is deleted to be replaced | 137 // Length in bytes of the text being completed (this is deleted to be replaced |
138 * by the match.) */ | 138 // by the match.) |
139 EXTERN int compl_length INIT(= 0); | 139 EXTERN int compl_length INIT(= 0); |
140 | 140 |
141 /* List of flags for method of completion. */ | 141 // List of flags for method of completion. |
142 EXTERN int compl_cont_status INIT(= 0); | 142 EXTERN int compl_cont_status INIT(= 0); |
143 # define CONT_ADDING 1 /* "normal" or "adding" expansion */ | 143 # define CONT_ADDING 1 // "normal" or "adding" expansion |
144 # define CONT_INTRPT (2 + 4) /* a ^X interrupted the current expansion */ | 144 # define CONT_INTRPT (2 + 4) // a ^X interrupted the current expansion |
145 /* it's set only iff N_ADDS is set */ | 145 // it's set only iff N_ADDS is set |
146 # define CONT_N_ADDS 4 /* next ^X<> will add-new or expand-current */ | 146 # define CONT_N_ADDS 4 // next ^X<> will add-new or expand-current |
147 # define CONT_S_IPOS 8 /* next ^X<> will set initial_pos? | 147 # define CONT_S_IPOS 8 // next ^X<> will set initial_pos? |
148 * if so, word-wise-expansion will set SOL */ | 148 // if so, word-wise-expansion will set SOL |
149 # define CONT_SOL 16 /* pattern includes start of line, just for | 149 # define CONT_SOL 16 // pattern includes start of line, just for |
150 * word-wise expansion, not set for ^X^L */ | 150 // word-wise expansion, not set for ^X^L |
151 # define CONT_LOCAL 32 /* for ctrl_x_mode 0, ^X^P/^X^N do a local | 151 # define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local |
152 * expansion, (eg use complete=.) */ | 152 // expansion, (eg use complete=.) |
153 #endif | 153 #endif |
154 | 154 |
155 /* | 155 /* |
156 * Functions for putting characters in the command line, | 156 * Functions for putting characters in the command line, |
157 * while keeping ScreenLines[] updated. | 157 * while keeping ScreenLines[] updated. |
158 */ | 158 */ |
159 #ifdef FEAT_RIGHTLEFT | 159 #ifdef FEAT_RIGHTLEFT |
160 EXTERN int cmdmsg_rl INIT(= FALSE); /* cmdline is drawn right to left */ | 160 EXTERN int cmdmsg_rl INIT(= FALSE); // cmdline is drawn right to left |
161 #endif | 161 #endif |
162 EXTERN int msg_col; | 162 EXTERN int msg_col; |
163 EXTERN int msg_row; | 163 EXTERN int msg_row; |
164 EXTERN int msg_scrolled; /* Number of screen lines that windows have | 164 EXTERN int msg_scrolled; // Number of screen lines that windows have |
165 * scrolled because of printing messages. */ | 165 // scrolled because of printing messages. |
166 EXTERN int msg_scrolled_ign INIT(= FALSE); | 166 EXTERN int msg_scrolled_ign INIT(= FALSE); |
167 /* when TRUE don't set need_wait_return in | 167 // when TRUE don't set need_wait_return in |
168 msg_puts_attr() when msg_scrolled is | 168 // msg_puts_attr() when msg_scrolled is |
169 non-zero */ | 169 // non-zero |
170 | 170 |
171 EXTERN char_u *keep_msg INIT(= NULL); /* msg to be shown after redraw */ | 171 EXTERN char_u *keep_msg INIT(= NULL); // msg to be shown after redraw |
172 EXTERN int keep_msg_attr INIT(= 0); /* highlight attr for keep_msg */ | 172 EXTERN int keep_msg_attr INIT(= 0); // highlight attr for keep_msg |
173 EXTERN int keep_msg_more INIT(= FALSE); /* keep_msg was set by msgmore() */ | 173 EXTERN int keep_msg_more INIT(= FALSE); // keep_msg was set by msgmore() |
174 EXTERN int need_fileinfo INIT(= FALSE);/* do fileinfo() after redraw */ | 174 EXTERN int need_fileinfo INIT(= FALSE);// do fileinfo() after redraw |
175 EXTERN int msg_scroll INIT(= FALSE); /* msg_start() will scroll */ | 175 EXTERN int msg_scroll INIT(= FALSE); // msg_start() will scroll |
176 EXTERN int msg_didout INIT(= FALSE); /* msg_outstr() was used in line */ | 176 EXTERN int msg_didout INIT(= FALSE); // msg_outstr() was used in line |
177 EXTERN int msg_didany INIT(= FALSE); /* msg_outstr() was used at all */ | 177 EXTERN int msg_didany INIT(= FALSE); // msg_outstr() was used at all |
178 EXTERN int msg_nowait INIT(= FALSE); /* don't wait for this msg */ | 178 EXTERN int msg_nowait INIT(= FALSE); // don't wait for this msg |
179 EXTERN int emsg_off INIT(= 0); /* don't display errors for now, | 179 EXTERN int emsg_off INIT(= 0); // don't display errors for now, |
180 unless 'debug' is set. */ | 180 // unless 'debug' is set. |
181 EXTERN int info_message INIT(= FALSE); /* printing informative message */ | 181 EXTERN int info_message INIT(= FALSE); // printing informative message |
182 EXTERN int msg_hist_off INIT(= FALSE); /* don't add messages to history */ | 182 EXTERN int msg_hist_off INIT(= FALSE); // don't add messages to history |
183 #ifdef FEAT_EVAL | 183 #ifdef FEAT_EVAL |
184 EXTERN int need_clr_eos INIT(= FALSE); /* need to clear text before | 184 EXTERN int need_clr_eos INIT(= FALSE); // need to clear text before |
185 displaying a message. */ | 185 // displaying a message. |
186 EXTERN int emsg_skip INIT(= 0); /* don't display errors for | 186 EXTERN int emsg_skip INIT(= 0); // don't display errors for |
187 expression that is skipped */ | 187 // expression that is skipped |
188 EXTERN int emsg_severe INIT(= FALSE); /* use message of next of several | 188 EXTERN int emsg_severe INIT(= FALSE); // use message of next of several |
189 emsg() calls for throw */ | 189 // emsg() calls for throw |
190 EXTERN int did_endif INIT(= FALSE); /* just had ":endif" */ | 190 EXTERN int did_endif INIT(= FALSE); // just had ":endif" |
191 EXTERN dict_T vimvardict; /* Dictionary with v: variables */ | 191 EXTERN dict_T vimvardict; // Dictionary with v: variables |
192 EXTERN dict_T globvardict; /* Dictionary with g: variables */ | 192 EXTERN dict_T globvardict; // Dictionary with g: variables |
193 #define globvarht globvardict.dv_hashtab | 193 #define globvarht globvardict.dv_hashtab |
194 #endif | 194 #endif |
195 EXTERN int did_emsg; /* set by emsg() when the message | 195 EXTERN int did_emsg; // set by emsg() when the message |
196 is displayed or thrown */ | 196 // is displayed or thrown |
197 #ifdef FEAT_EVAL | 197 #ifdef FEAT_EVAL |
198 EXTERN int called_vim_beep; /* set if vim_beep() is called */ | 198 EXTERN int called_vim_beep; // set if vim_beep() is called |
199 EXTERN int did_uncaught_emsg; /* emsg() was called and did not | 199 EXTERN int did_uncaught_emsg; // emsg() was called and did not |
200 cause an exception */ | 200 // cause an exception |
201 #endif | 201 #endif |
202 EXTERN int did_emsg_syntax; /* did_emsg set because of a | 202 EXTERN int did_emsg_syntax; // did_emsg set because of a |
203 syntax error */ | 203 // syntax error |
204 EXTERN int called_emsg; /* always set by emsg() */ | 204 EXTERN int called_emsg; // always set by emsg() |
205 EXTERN int ex_exitval INIT(= 0); /* exit value for ex mode */ | 205 EXTERN int ex_exitval INIT(= 0); // exit value for ex mode |
206 EXTERN int emsg_on_display INIT(= FALSE); /* there is an error message */ | 206 EXTERN int emsg_on_display INIT(= FALSE); // there is an error message |
207 EXTERN int rc_did_emsg INIT(= FALSE); /* vim_regcomp() called emsg() */ | 207 EXTERN int rc_did_emsg INIT(= FALSE); // vim_regcomp() called emsg() |
208 | 208 |
209 EXTERN int no_wait_return INIT(= 0); /* don't wait for return for now */ | 209 EXTERN int no_wait_return INIT(= 0); // don't wait for return for now |
210 EXTERN int need_wait_return INIT(= 0); /* need to wait for return later */ | 210 EXTERN int need_wait_return INIT(= 0); // need to wait for return later |
211 EXTERN int did_wait_return INIT(= FALSE); /* wait_return() was used and | 211 EXTERN int did_wait_return INIT(= FALSE); // wait_return() was used and |
212 nothing written since then */ | 212 // nothing written since then |
213 #ifdef FEAT_TITLE | 213 #ifdef FEAT_TITLE |
214 EXTERN int need_maketitle INIT(= TRUE); /* call maketitle() soon */ | 214 EXTERN int need_maketitle INIT(= TRUE); // call maketitle() soon |
215 #endif | 215 #endif |
216 | 216 |
217 EXTERN int quit_more INIT(= FALSE); /* 'q' hit at "--more--" msg */ | 217 EXTERN int quit_more INIT(= FALSE); // 'q' hit at "--more--" msg |
218 #if defined(UNIX) || defined(VMS) || defined(MACOS_X) | 218 #if defined(UNIX) || defined(VMS) || defined(MACOS_X) |
219 EXTERN int newline_on_exit INIT(= FALSE); /* did msg in altern. screen */ | 219 EXTERN int newline_on_exit INIT(= FALSE); // did msg in altern. screen |
220 EXTERN int intr_char INIT(= 0); /* extra interrupt character */ | 220 EXTERN int intr_char INIT(= 0); // extra interrupt character |
221 #endif | 221 #endif |
222 #if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11) | 222 #if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11) |
223 EXTERN int x_no_connect INIT(= FALSE); /* don't connect to X server */ | 223 EXTERN int x_no_connect INIT(= FALSE); // don't connect to X server |
224 # if defined(FEAT_CLIENTSERVER) | 224 # if defined(FEAT_CLIENTSERVER) |
225 EXTERN int x_force_connect INIT(= FALSE); /* Do connect to X server. | 225 EXTERN int x_force_connect INIT(= FALSE); // Do connect to X server. |
226 Overrules x_no_connect and | 226 // Overrules x_no_connect and |
227 "exclude" in 'clipboard'. */ | 227 // "exclude" in 'clipboard'. |
228 # endif | 228 # endif |
229 #endif | 229 #endif |
230 EXTERN int ex_keep_indent INIT(= FALSE); /* getexmodeline(): keep indent */ | 230 EXTERN int ex_keep_indent INIT(= FALSE); // getexmodeline(): keep indent |
231 EXTERN int vgetc_busy INIT(= 0); /* when inside vgetc() then > 0 */ | 231 EXTERN int vgetc_busy INIT(= 0); // when inside vgetc() then > 0 |
232 | 232 |
233 EXTERN int didset_vim INIT(= FALSE); /* did set $VIM ourselves */ | 233 EXTERN int didset_vim INIT(= FALSE); // did set $VIM ourselves |
234 EXTERN int didset_vimruntime INIT(= FALSE); /* idem for $VIMRUNTIME */ | 234 EXTERN int didset_vimruntime INIT(= FALSE); // idem for $VIMRUNTIME |
235 | 235 |
236 /* | 236 /* |
237 * Lines left before a "more" message. Ex mode needs to be able to reset this | 237 * Lines left before a "more" message. Ex mode needs to be able to reset this |
238 * after you type something. | 238 * after you type something. |
239 */ | 239 */ |
240 EXTERN int lines_left INIT(= -1); /* lines left for listing */ | 240 EXTERN int lines_left INIT(= -1); // lines left for listing |
241 EXTERN int msg_no_more INIT(= FALSE); /* don't use more prompt, truncate | 241 EXTERN int msg_no_more INIT(= FALSE); // don't use more prompt, truncate |
242 messages */ | 242 // messages |
243 | 243 |
244 EXTERN char_u *sourcing_name INIT( = NULL);/* name of error message source */ | 244 EXTERN char_u *sourcing_name INIT( = NULL);// name of error message source |
245 EXTERN linenr_T sourcing_lnum INIT(= 0); /* line number of the source file */ | 245 EXTERN linenr_T sourcing_lnum INIT(= 0); // line number of the source file |
246 | 246 |
247 #ifdef FEAT_EVAL | 247 #ifdef FEAT_EVAL |
248 EXTERN int ex_nesting_level INIT(= 0); /* nesting level */ | 248 EXTERN int ex_nesting_level INIT(= 0); // nesting level |
249 EXTERN int debug_break_level INIT(= -1); /* break below this level */ | 249 EXTERN int debug_break_level INIT(= -1); // break below this level |
250 EXTERN int debug_did_msg INIT(= FALSE); /* did "debug mode" message */ | 250 EXTERN int debug_did_msg INIT(= FALSE); // did "debug mode" message |
251 EXTERN int debug_tick INIT(= 0); /* breakpoint change count */ | 251 EXTERN int debug_tick INIT(= 0); // breakpoint change count |
252 EXTERN int debug_backtrace_level INIT(= 0); /* breakpoint backtrace level */ | 252 EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level |
253 # ifdef FEAT_PROFILE | 253 # ifdef FEAT_PROFILE |
254 EXTERN int do_profiling INIT(= PROF_NONE); /* PROF_ values */ | 254 EXTERN int do_profiling INIT(= PROF_NONE); // PROF_ values |
255 # endif | 255 # endif |
256 EXTERN garray_T script_items INIT(= {0 COMMA 0 COMMA sizeof(scriptitem_T) COMMA 4 COMMA NULL}); | 256 EXTERN garray_T script_items INIT(= {0 COMMA 0 COMMA sizeof(scriptitem_T) COMMA 4 COMMA NULL}); |
257 #define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) | 257 #define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) |
258 #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] | 258 #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] |
259 | 259 |
346 EXTERN sctx_T current_sctx INIT(= {0 COMMA 0 COMMA 0 COMMA 0}); | 346 EXTERN sctx_T current_sctx INIT(= {0 COMMA 0 COMMA 0 COMMA 0}); |
347 #endif | 347 #endif |
348 | 348 |
349 EXTERN int did_source_packages INIT(= FALSE); | 349 EXTERN int did_source_packages INIT(= FALSE); |
350 | 350 |
351 /* Magic number used for hashitem "hi_key" value indicating a deleted item. | 351 // Magic number used for hashitem "hi_key" value indicating a deleted item. |
352 * Only the address is used. */ | 352 // Only the address is used. |
353 EXTERN char_u hash_removed; | 353 EXTERN char_u hash_removed; |
354 | 354 |
355 | 355 |
356 EXTERN int scroll_region INIT(= FALSE); /* term supports scroll region */ | 356 EXTERN int scroll_region INIT(= FALSE); // term supports scroll region |
357 EXTERN int t_colors INIT(= 0); /* int value of T_CCO */ | 357 EXTERN int t_colors INIT(= 0); // int value of T_CCO |
358 | 358 |
359 #ifdef FEAT_CMDL_COMPL | 359 #ifdef FEAT_CMDL_COMPL |
360 // Flags to indicate an additional string for highlight name completion. | 360 // Flags to indicate an additional string for highlight name completion. |
361 EXTERN int include_none INIT(= 0); // when 1 include "None" | 361 EXTERN int include_none INIT(= 0); // when 1 include "None" |
362 EXTERN int include_default INIT(= 0); // when 1 include "default" | 362 EXTERN int include_default INIT(= 0); // when 1 include "default" |
375 #ifdef FEAT_SEARCH_EXTRA | 375 #ifdef FEAT_SEARCH_EXTRA |
376 EXTERN linenr_T search_first_line INIT(= 0); // for :{FIRST},{last}s/pat | 376 EXTERN linenr_T search_first_line INIT(= 0); // for :{FIRST},{last}s/pat |
377 EXTERN linenr_T search_last_line INIT(= MAXLNUM); // for :{first},{LAST}s/pat | 377 EXTERN linenr_T search_last_line INIT(= MAXLNUM); // for :{first},{LAST}s/pat |
378 #endif | 378 #endif |
379 | 379 |
380 EXTERN int no_smartcase INIT(= FALSE); /* don't use 'smartcase' once */ | 380 EXTERN int no_smartcase INIT(= FALSE); // don't use 'smartcase' once |
381 | 381 |
382 EXTERN int need_check_timestamps INIT(= FALSE); /* need to check file | 382 EXTERN int need_check_timestamps INIT(= FALSE); // need to check file |
383 timestamps asap */ | 383 // timestamps asap |
384 EXTERN int did_check_timestamps INIT(= FALSE); /* did check timestamps | 384 EXTERN int did_check_timestamps INIT(= FALSE); // did check timestamps |
385 recently */ | 385 // recently |
386 EXTERN int no_check_timestamps INIT(= 0); /* Don't check timestamps */ | 386 EXTERN int no_check_timestamps INIT(= 0); // Don't check timestamps |
387 | 387 |
388 EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */ | 388 EXTERN int highlight_attr[HLF_COUNT]; // Highl. attr for each context. |
389 #ifdef FEAT_STL_OPT | 389 #ifdef FEAT_STL_OPT |
390 # define USER_HIGHLIGHT | 390 # define USER_HIGHLIGHT |
391 #endif | 391 #endif |
392 #ifdef USER_HIGHLIGHT | 392 #ifdef USER_HIGHLIGHT |
393 EXTERN int highlight_user[9]; /* User[1-9] attributes */ | 393 EXTERN int highlight_user[9]; // User[1-9] attributes |
394 # ifdef FEAT_STL_OPT | 394 # ifdef FEAT_STL_OPT |
395 EXTERN int highlight_stlnc[9]; /* On top of user */ | 395 EXTERN int highlight_stlnc[9]; // On top of user |
396 # ifdef FEAT_TERMINAL | 396 # ifdef FEAT_TERMINAL |
397 EXTERN int highlight_stlterm[9]; /* On top of user */ | 397 EXTERN int highlight_stlterm[9]; // On top of user |
398 EXTERN int highlight_stltermnc[9]; /* On top of user */ | 398 EXTERN int highlight_stltermnc[9]; // On top of user |
399 # endif | 399 # endif |
400 # endif | 400 # endif |
401 #endif | 401 #endif |
402 #ifdef FEAT_TERMINAL | 402 #ifdef FEAT_TERMINAL |
403 // When TRUE skip calling terminal_loop() once. Used when | 403 // When TRUE skip calling terminal_loop() once. Used when |
404 // typing ':' at the more prompt. | 404 // typing ':' at the more prompt. |
405 EXTERN int skip_term_loop INIT(= FALSE); | 405 EXTERN int skip_term_loop INIT(= FALSE); |
406 #endif | 406 #endif |
407 #ifdef FEAT_GUI | 407 #ifdef FEAT_GUI |
408 EXTERN char_u *use_gvimrc INIT(= NULL); /* "-U" cmdline argument */ | 408 EXTERN char_u *use_gvimrc INIT(= NULL); // "-U" cmdline argument |
409 #endif | 409 #endif |
410 EXTERN int cterm_normal_fg_color INIT(= 0); | 410 EXTERN int cterm_normal_fg_color INIT(= 0); |
411 EXTERN int cterm_normal_fg_bold INIT(= 0); | 411 EXTERN int cterm_normal_fg_bold INIT(= 0); |
412 EXTERN int cterm_normal_bg_color INIT(= 0); | 412 EXTERN int cterm_normal_bg_color INIT(= 0); |
413 #ifdef FEAT_TERMGUICOLORS | 413 #ifdef FEAT_TERMGUICOLORS |
414 EXTERN guicolor_T cterm_normal_fg_gui_color INIT(= INVALCOLOR); | 414 EXTERN guicolor_T cterm_normal_fg_gui_color INIT(= INVALCOLOR); |
415 EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR); | 415 EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR); |
416 #endif | 416 #endif |
417 #ifdef FEAT_TERMRESPONSE | 417 #ifdef FEAT_TERMRESPONSE |
418 EXTERN int is_mac_terminal INIT(= FALSE); /* recognized Terminal.app */ | 418 EXTERN int is_mac_terminal INIT(= FALSE); // recognized Terminal.app |
419 #endif | 419 #endif |
420 | 420 |
421 EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */ | 421 EXTERN int autocmd_busy INIT(= FALSE); // Is apply_autocmds() busy? |
422 EXTERN int autocmd_no_enter INIT(= FALSE); /* *Enter autocmds disabled */ | 422 EXTERN int autocmd_no_enter INIT(= FALSE); // *Enter autocmds disabled |
423 EXTERN int autocmd_no_leave INIT(= FALSE); /* *Leave autocmds disabled */ | 423 EXTERN int autocmd_no_leave INIT(= FALSE); // *Leave autocmds disabled |
424 EXTERN int modified_was_set; /* did ":set modified" */ | 424 |
425 EXTERN int did_filetype INIT(= FALSE); /* FileType event found */ | 425 EXTERN int modified_was_set; // did ":set modified" |
426 EXTERN int did_filetype INIT(= FALSE); // FileType event found | |
426 EXTERN int au_did_filetype INIT(= FALSE); | 427 EXTERN int au_did_filetype INIT(= FALSE); |
427 EXTERN int keep_filetype INIT(= FALSE); /* value for did_filetype when | 428 EXTERN int keep_filetype INIT(= FALSE); // value for did_filetype when |
428 starting to execute | 429 // starting to execute |
429 autocommands */ | 430 // autocommands |
430 | 431 |
431 /* When deleting the current buffer, another one must be loaded. If we know | 432 // When deleting the current buffer, another one must be loaded. If we know |
432 * which one is preferred, au_new_curbuf is set to it */ | 433 // which one is preferred, au_new_curbuf is set to it |
433 EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0}); | 434 EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0}); |
434 | 435 |
435 /* When deleting a buffer/window and autocmd_busy is TRUE, do not free the | 436 // When deleting a buffer/window and autocmd_busy is TRUE, do not free the |
436 * buffer/window. but link it in the list starting with | 437 // buffer/window. but link it in the list starting with |
437 * au_pending_free_buf/ap_pending_free_win, using b_next/w_next. | 438 // au_pending_free_buf/ap_pending_free_win, using b_next/w_next. |
438 * Free the buffer/window when autocmd_busy is being set to FALSE. */ | 439 // Free the buffer/window when autocmd_busy is being set to FALSE. |
439 EXTERN buf_T *au_pending_free_buf INIT(= NULL); | 440 EXTERN buf_T *au_pending_free_buf INIT(= NULL); |
440 EXTERN win_T *au_pending_free_win INIT(= NULL); | 441 EXTERN win_T *au_pending_free_win INIT(= NULL); |
441 | 442 |
442 #ifdef FEAT_MOUSE | 443 #ifdef FEAT_MOUSE |
443 /* | 444 /* |
444 * Mouse coordinates, set by check_termcode() | 445 * Mouse coordinates, set by check_termcode() |
445 */ | 446 */ |
446 EXTERN int mouse_row; | 447 EXTERN int mouse_row; |
447 EXTERN int mouse_col; | 448 EXTERN int mouse_col; |
448 EXTERN int mouse_past_bottom INIT(= FALSE);/* mouse below last line */ | 449 EXTERN int mouse_past_bottom INIT(= FALSE);// mouse below last line |
449 EXTERN int mouse_past_eol INIT(= FALSE); /* mouse right of line */ | 450 EXTERN int mouse_past_eol INIT(= FALSE); // mouse right of line |
450 EXTERN int mouse_dragging INIT(= 0); /* extending Visual area with | 451 EXTERN int mouse_dragging INIT(= 0); // extending Visual area with |
451 mouse dragging */ | 452 // mouse dragging |
452 # if defined(FEAT_MOUSE_DEC) | 453 # if defined(FEAT_MOUSE_DEC) |
453 /* | 454 /* |
454 * When the DEC mouse has been pressed but not yet released we enable | 455 * When the DEC mouse has been pressed but not yet released we enable |
455 * automatic queries for the mouse position. | 456 * automatic queries for the mouse position. |
456 */ | 457 */ |
457 EXTERN int WantQueryMouse INIT(= FALSE); | 458 EXTERN int WantQueryMouse INIT(= FALSE); |
458 # endif | 459 # endif |
459 | 460 |
460 # ifdef FEAT_GUI | 461 # ifdef FEAT_GUI |
461 /* When the window layout is about to be changed, need_mouse_correct is set, | 462 // When the window layout is about to be changed, need_mouse_correct is set, |
462 * so that gui_mouse_correct() is called afterwards, to correct the mouse | 463 // so that gui_mouse_correct() is called afterwards, to correct the mouse |
463 * pointer when focus-follow-mouse is being used. */ | 464 // pointer when focus-follow-mouse is being used. |
464 EXTERN int need_mouse_correct INIT(= FALSE); | 465 EXTERN int need_mouse_correct INIT(= FALSE); |
465 | 466 |
466 /* When double clicking, topline must be the same */ | 467 // When double clicking, topline must be the same |
467 EXTERN linenr_T gui_prev_topline INIT(= 0); | 468 EXTERN linenr_T gui_prev_topline INIT(= 0); |
468 # ifdef FEAT_DIFF | 469 # ifdef FEAT_DIFF |
469 EXTERN int gui_prev_topfill INIT(= 0); | 470 EXTERN int gui_prev_topfill INIT(= 0); |
470 # endif | 471 # endif |
471 # endif | 472 # endif |
472 | 473 |
473 # ifdef FEAT_MOUSESHAPE | 474 # ifdef FEAT_MOUSESHAPE |
474 EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */ | 475 EXTERN int drag_status_line INIT(= FALSE); // dragging the status line |
475 EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the | 476 EXTERN int postponed_mouseshape INIT(= FALSE); // postponed updating the |
476 mouse pointer shape */ | 477 // mouse pointer shape |
477 EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */ | 478 EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator |
478 # endif | 479 # endif |
479 | 480 |
480 #endif | 481 #endif |
481 | 482 |
482 #ifdef FEAT_DIFF | 483 #ifdef FEAT_DIFF |
483 /* Value set from 'diffopt'. */ | 484 // Value set from 'diffopt'. |
484 EXTERN int diff_context INIT(= 6); /* context for folds */ | 485 EXTERN int diff_context INIT(= 6); // context for folds |
485 EXTERN int diff_foldcolumn INIT(= 2); /* 'foldcolumn' for diff mode */ | 486 EXTERN int diff_foldcolumn INIT(= 2); // 'foldcolumn' for diff mode |
486 EXTERN int diff_need_scrollbind INIT(= FALSE); | 487 EXTERN int diff_need_scrollbind INIT(= FALSE); |
487 #endif | 488 #endif |
488 | 489 |
490 // While redrawing the screen this flag is set. It means the screen size | |
491 // ('lines' and 'rows') must not be changed. | |
492 EXTERN int updating_screen INIT(= FALSE); | |
493 | |
489 #ifdef FEAT_MENU | 494 #ifdef FEAT_MENU |
490 /* The root of the menu hierarchy. */ | 495 // The root of the menu hierarchy. |
491 EXTERN vimmenu_T *root_menu INIT(= NULL); | 496 EXTERN vimmenu_T *root_menu INIT(= NULL); |
492 /* | 497 /* |
493 * While defining the system menu, sys_menu is TRUE. This avoids | 498 * While defining the system menu, sys_menu is TRUE. This avoids |
494 * overruling of menus that the user already defined. | 499 * overruling of menus that the user already defined. |
495 */ | 500 */ |
496 EXTERN int sys_menu INIT(= FALSE); | 501 EXTERN int sys_menu INIT(= FALSE); |
497 #endif | 502 #endif |
498 | 503 |
499 /* While redrawing the screen this flag is set. It means the screen size | |
500 * ('lines' and 'rows') must not be changed. */ | |
501 EXTERN int updating_screen INIT(= FALSE); | |
502 | |
503 #ifdef FEAT_GUI | 504 #ifdef FEAT_GUI |
504 # ifdef FEAT_MENU | 505 # ifdef FEAT_MENU |
505 /* Menu item just selected, set by check_termcode() */ | 506 // Menu item just selected, set by check_termcode() |
506 EXTERN vimmenu_T *current_menu; | 507 EXTERN vimmenu_T *current_menu; |
507 | 508 |
508 /* Set to TRUE after adding/removing menus to ensure they are updated */ | 509 // Set to TRUE after adding/removing menus to ensure they are updated |
509 EXTERN int force_menu_update INIT(= FALSE); | 510 EXTERN int force_menu_update INIT(= FALSE); |
510 # endif | 511 # endif |
511 # ifdef FEAT_GUI_TABLINE | 512 # ifdef FEAT_GUI_TABLINE |
512 /* Tab in tab pages line just selected, set by check_termcode() */ | 513 // Tab in tab pages line just selected, set by check_termcode() |
513 EXTERN int current_tab; | 514 EXTERN int current_tab; |
514 | 515 |
515 /* Menu entry in tab pages line menu just selected, set by check_termcode() */ | 516 // Menu entry in tab pages line menu just selected, set by check_termcode() |
516 EXTERN int current_tabmenu; | 517 EXTERN int current_tabmenu; |
517 # define TABLINE_MENU_CLOSE 1 | 518 # define TABLINE_MENU_CLOSE 1 |
518 # define TABLINE_MENU_NEW 2 | 519 # define TABLINE_MENU_NEW 2 |
519 # define TABLINE_MENU_OPEN 3 | 520 # define TABLINE_MENU_OPEN 3 |
520 # endif | 521 # endif |
521 | 522 |
522 /* Scrollbar moved and new value, set by check_termcode() */ | 523 // Scrollbar moved and new value, set by check_termcode() |
523 EXTERN int current_scrollbar; | 524 EXTERN int current_scrollbar; |
524 EXTERN long_u scrollbar_value; | 525 EXTERN long_u scrollbar_value; |
525 | 526 |
526 /* found "-rv" or "-reverse" in command line args */ | 527 // found "-rv" or "-reverse" in command line args |
527 EXTERN int found_reverse_arg INIT(= FALSE); | 528 EXTERN int found_reverse_arg INIT(= FALSE); |
528 | 529 |
529 /* "-fn" or "-font" command line argument */ | 530 // "-fn" or "-font" command line argument |
530 EXTERN char *font_argument INIT(= NULL); | 531 EXTERN char *font_argument INIT(= NULL); |
531 | 532 |
532 # ifdef FEAT_GUI_GTK | 533 # ifdef FEAT_GUI_GTK |
533 /* "-bg" or "-background" command line argument */ | 534 // "-bg" or "-background" command line argument |
534 EXTERN char *background_argument INIT(= NULL); | 535 EXTERN char *background_argument INIT(= NULL); |
535 | 536 |
536 /* "-fg" or "-foreground" command line argument */ | 537 // "-fg" or "-foreground" command line argument |
537 EXTERN char *foreground_argument INIT(= NULL); | 538 EXTERN char *foreground_argument INIT(= NULL); |
538 # endif | 539 # endif |
539 | 540 |
540 /* | 541 /* |
541 * While executing external commands or in Ex mode, should not insert GUI | 542 * While executing external commands or in Ex mode, should not insert GUI |
550 * gui_resize_shell() later. | 551 * gui_resize_shell() later. |
551 */ | 552 */ |
552 EXTERN int new_pixel_width INIT(= 0); | 553 EXTERN int new_pixel_width INIT(= 0); |
553 EXTERN int new_pixel_height INIT(= 0); | 554 EXTERN int new_pixel_height INIT(= 0); |
554 | 555 |
555 /* Window position from ":winpos", to be used when opening the GUI window. */ | 556 // Window position from ":winpos", to be used when opening the GUI window. |
556 EXTERN int gui_win_x INIT(= -1); | 557 EXTERN int gui_win_x INIT(= -1); |
557 EXTERN int gui_win_y INIT(= -1); | 558 EXTERN int gui_win_y INIT(= -1); |
558 #endif | 559 #endif |
559 | 560 |
560 #ifdef FEAT_CLIPBOARD | 561 #ifdef FEAT_CLIPBOARD |
566 # define ONE_CLIPBOARD | 567 # define ONE_CLIPBOARD |
567 # endif | 568 # endif |
568 | 569 |
569 # define CLIP_UNNAMED 1 | 570 # define CLIP_UNNAMED 1 |
570 # define CLIP_UNNAMED_PLUS 2 | 571 # define CLIP_UNNAMED_PLUS 2 |
571 EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */ | 572 EXTERN int clip_unnamed INIT(= 0); // above two values or'ed |
572 | 573 |
573 EXTERN int clip_autoselect_star INIT(= FALSE); | 574 EXTERN int clip_autoselect_star INIT(= FALSE); |
574 EXTERN int clip_autoselect_plus INIT(= FALSE); | 575 EXTERN int clip_autoselect_plus INIT(= FALSE); |
575 EXTERN int clip_autoselectml INIT(= FALSE); | 576 EXTERN int clip_autoselectml INIT(= FALSE); |
576 EXTERN int clip_html INIT(= FALSE); | 577 EXTERN int clip_html INIT(= FALSE); |
582 * All regular windows are linked in a list. "firstwin" points to the first | 583 * All regular windows are linked in a list. "firstwin" points to the first |
583 * entry, "lastwin" to the last entry (can be the same as firstwin) and | 584 * entry, "lastwin" to the last entry (can be the same as firstwin) and |
584 * "curwin" to the currently active window. | 585 * "curwin" to the currently active window. |
585 * When switching tabs these swapped with the pointers in "tabpage_T". | 586 * When switching tabs these swapped with the pointers in "tabpage_T". |
586 */ | 587 */ |
587 EXTERN win_T *firstwin; /* first window */ | 588 EXTERN win_T *firstwin; // first window |
588 EXTERN win_T *lastwin; /* last window */ | 589 EXTERN win_T *lastwin; // last window |
589 EXTERN win_T *prevwin INIT(= NULL); /* previous window */ | 590 EXTERN win_T *prevwin INIT(= NULL); // previous window |
590 #define ONE_WINDOW (firstwin == lastwin) | 591 #define ONE_WINDOW (firstwin == lastwin) |
591 #define W_NEXT(wp) ((wp)->w_next) | 592 #define W_NEXT(wp) ((wp)->w_next) |
592 #define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) | 593 #define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) |
593 #define FOR_ALL_FRAMES(frp, first_frame) \ | 594 #define FOR_ALL_FRAMES(frp, first_frame) \ |
594 for (frp = first_frame; frp != NULL; frp = frp->fr_next) | 595 for (frp = first_frame; frp != NULL; frp = frp->fr_next) |
604 for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ | 605 for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ |
605 for ((wp) = ((tp) == curtab) \ | 606 for ((wp) = ((tp) == curtab) \ |
606 ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) | 607 ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) |
607 | 608 |
608 | 609 |
609 EXTERN win_T *curwin; /* currently active window */ | 610 EXTERN win_T *curwin; // currently active window |
610 | 611 |
611 EXTERN win_T *aucmd_win; /* window used in aucmd_prepbuf() */ | 612 EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf() |
612 EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */ | 613 EXTERN int aucmd_win_used INIT(= FALSE); // aucmd_win is being used |
613 | 614 |
614 #ifdef FEAT_TEXT_PROP | 615 #ifdef FEAT_TEXT_PROP |
615 EXTERN win_T *first_popupwin; // first global popup window | 616 EXTERN win_T *first_popupwin; // first global popup window |
616 EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged | 617 EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged |
617 | 618 |
618 // Set to TRUE if there is any visible popup. | 619 // Set to TRUE if there is any visible popup window. |
619 EXTERN int popup_visible INIT(= FALSE); | 620 EXTERN int popup_visible INIT(= FALSE); |
620 | 621 |
621 EXTERN int text_prop_frozen INIT(= 0); | 622 EXTERN int text_prop_frozen INIT(= 0); |
622 #endif | 623 #endif |
623 | 624 |
624 /* | 625 /* |
625 * The window layout is kept in a tree of frames. topframe points to the top | 626 * The window layout is kept in a tree of frames. topframe points to the top |
626 * of the tree. | 627 * of the tree. |
627 */ | 628 */ |
628 EXTERN frame_T *topframe; /* top of the window frame tree */ | 629 EXTERN frame_T *topframe; // top of the window frame tree |
629 | 630 |
630 /* | 631 /* |
631 * Tab pages are alternative topframes. "first_tabpage" points to the first | 632 * Tab pages are alternative topframes. "first_tabpage" points to the first |
632 * one in the list, "curtab" is the current one. | 633 * one in the list, "curtab" is the current one. |
633 */ | 634 */ |
634 EXTERN tabpage_T *first_tabpage; | 635 EXTERN tabpage_T *first_tabpage; |
635 EXTERN tabpage_T *curtab; | 636 EXTERN tabpage_T *curtab; |
636 EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */ | 637 EXTERN int redraw_tabline INIT(= FALSE); // need to redraw tabline |
637 | 638 |
638 /* | 639 /* |
639 * All buffers are linked in a list. 'firstbuf' points to the first entry, | 640 * All buffers are linked in a list. 'firstbuf' points to the first entry, |
640 * 'lastbuf' to the last entry and 'curbuf' to the currently active buffer. | 641 * 'lastbuf' to the last entry and 'curbuf' to the currently active buffer. |
641 */ | 642 */ |
642 EXTERN buf_T *firstbuf INIT(= NULL); /* first buffer */ | 643 EXTERN buf_T *firstbuf INIT(= NULL); // first buffer |
643 EXTERN buf_T *lastbuf INIT(= NULL); /* last buffer */ | 644 EXTERN buf_T *lastbuf INIT(= NULL); // last buffer |
644 EXTERN buf_T *curbuf INIT(= NULL); /* currently active buffer */ | 645 EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer |
645 | 646 |
646 #define FOR_ALL_BUFFERS(buf) for (buf = firstbuf; buf != NULL; buf = buf->b_next) | 647 #define FOR_ALL_BUFFERS(buf) for (buf = firstbuf; buf != NULL; buf = buf->b_next) |
647 | 648 |
648 // Iterate through all the signs placed in a buffer | 649 // Iterate through all the signs placed in a buffer |
649 #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \ | 650 #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \ |
650 for (sign = buf->b_signlist; sign != NULL; sign = sign->next) | 651 for (sign = buf->b_signlist; sign != NULL; sign = sign->next) |
651 | 652 |
652 /* Flag that is set when switching off 'swapfile'. It means that all blocks | 653 // Flag that is set when switching off 'swapfile'. It means that all blocks |
653 * are to be loaded into memory. Shouldn't be global... */ | 654 // are to be loaded into memory. Shouldn't be global... |
654 EXTERN int mf_dont_release INIT(= FALSE); /* don't release blocks */ | 655 EXTERN int mf_dont_release INIT(= FALSE); // don't release blocks |
655 | 656 |
656 /* | 657 /* |
657 * List of files being edited (global argument list). curwin->w_alist points | 658 * List of files being edited (global argument list). curwin->w_alist points |
658 * to this when the window is using the global argument list. | 659 * to this when the window is using the global argument list. |
659 */ | 660 */ |
660 EXTERN alist_T global_alist; /* global argument list */ | 661 EXTERN alist_T global_alist; // global argument list |
661 EXTERN int max_alist_id INIT(= 0); /* the previous argument list id */ | 662 EXTERN int max_alist_id INIT(= 0); // the previous argument list id |
662 EXTERN int arg_had_last INIT(= FALSE); /* accessed last file in | 663 EXTERN int arg_had_last INIT(= FALSE); // accessed last file in |
663 global_alist */ | 664 // global_alist |
664 | 665 |
665 EXTERN int ru_col; /* column for ruler */ | 666 EXTERN int ru_col; // column for ruler |
666 #ifdef FEAT_STL_OPT | 667 #ifdef FEAT_STL_OPT |
667 EXTERN int ru_wid; /* 'rulerfmt' width of ruler when non-zero */ | 668 EXTERN int ru_wid; // 'rulerfmt' width of ruler when non-zero |
668 #endif | 669 #endif |
669 EXTERN int sc_col; /* column for shown command */ | 670 EXTERN int sc_col; // column for shown command |
670 | 671 |
671 #ifdef TEMPDIRNAMES | 672 #ifdef TEMPDIRNAMES |
672 EXTERN char_u *vim_tempdir INIT(= NULL); /* Name of Vim's own temp dir. | 673 EXTERN char_u *vim_tempdir INIT(= NULL); // Name of Vim's own temp dir. |
673 Ends in a slash. */ | 674 // Ends in a slash. |
674 #endif | 675 #endif |
675 | 676 |
676 /* | 677 /* |
677 * When starting or exiting some things are done differently (e.g. screen | 678 * When starting or exiting some things are done differently (e.g. screen |
678 * updating). | 679 * updating). |
679 */ | 680 */ |
680 EXTERN int starting INIT(= NO_SCREEN); | 681 EXTERN int starting INIT(= NO_SCREEN); |
681 /* first NO_SCREEN, then NO_BUFFERS and then | 682 // first NO_SCREEN, then NO_BUFFERS and then |
682 * set to 0 when starting up finished */ | 683 // set to 0 when starting up finished |
683 EXTERN int exiting INIT(= FALSE); | 684 EXTERN int exiting INIT(= FALSE); |
684 /* TRUE when planning to exit Vim. Might | 685 // TRUE when planning to exit Vim. Might |
685 * still keep on running if there is a changed | 686 // still keep on running if there is a changed |
686 * buffer. */ | 687 // buffer. |
687 EXTERN int really_exiting INIT(= FALSE); | 688 EXTERN int really_exiting INIT(= FALSE); |
688 /* TRUE when we are sure to exit, e.g., after | 689 // TRUE when we are sure to exit, e.g., after |
689 * a deadly signal */ | 690 // a deadly signal |
690 EXTERN int v_dying INIT(= 0); /* internal value of v:dying */ | 691 EXTERN int v_dying INIT(= 0); // internal value of v:dying |
691 EXTERN int stdout_isatty INIT(= TRUE); /* is stdout a terminal? */ | 692 EXTERN int stdout_isatty INIT(= TRUE); // is stdout a terminal? |
692 | 693 |
693 #if defined(FEAT_AUTOCHDIR) | 694 #if defined(FEAT_AUTOCHDIR) |
694 EXTERN int test_autochdir INIT(= FALSE); | 695 EXTERN int test_autochdir INIT(= FALSE); |
695 #endif | 696 #endif |
696 #if defined(EXITFREE) | 697 #if defined(EXITFREE) |
697 EXTERN int entered_free_all_mem INIT(= FALSE); | 698 EXTERN int entered_free_all_mem INIT(= FALSE); |
698 /* TRUE when in or after free_all_mem() */ | 699 // TRUE when in or after free_all_mem() |
699 #endif | 700 #endif |
700 /* volatile because it is used in signal handler deathtrap(). */ | 701 // volatile because it is used in signal handler deathtrap(). |
701 EXTERN volatile sig_atomic_t full_screen INIT(= FALSE); | 702 EXTERN volatile sig_atomic_t full_screen INIT(= FALSE); |
702 /* TRUE when doing full-screen output | 703 // TRUE when doing full-screen output |
703 * otherwise only writing some messages */ | 704 // otherwise only writing some messages |
704 | 705 |
705 EXTERN int restricted INIT(= FALSE); | 706 EXTERN int restricted INIT(= FALSE); |
706 /* TRUE when started as "rvim" */ | 707 // TRUE when started as "rvim" |
707 EXTERN int secure INIT(= FALSE); | 708 EXTERN int secure INIT(= FALSE); |
708 /* non-zero when only "safe" commands are | 709 // non-zero when only "safe" commands are |
709 * allowed, e.g. when sourcing .exrc or .vimrc | 710 // allowed, e.g. when sourcing .exrc or .vimrc |
710 * in current directory */ | 711 // in current directory |
711 | 712 |
712 EXTERN int textlock INIT(= 0); | 713 EXTERN int textlock INIT(= 0); |
713 /* non-zero when changing text and jumping to | 714 // non-zero when changing text and jumping to |
714 * another window or buffer is not allowed */ | 715 // another window or buffer is not allowed |
715 | 716 |
716 EXTERN int curbuf_lock INIT(= 0); | 717 EXTERN int curbuf_lock INIT(= 0); |
717 /* non-zero when the current buffer can't be | 718 // non-zero when the current buffer can't be |
718 * changed. Used for FileChangedRO. */ | 719 // changed. Used for FileChangedRO. |
719 EXTERN int allbuf_lock INIT(= 0); | 720 EXTERN int allbuf_lock INIT(= 0); |
720 /* non-zero when no buffer name can be | 721 // non-zero when no buffer name can be |
721 * changed, no buffer can be deleted and | 722 // changed, no buffer can be deleted and |
722 * current directory can't be changed. | 723 // current directory can't be changed. |
723 * Used for SwapExists et al. */ | 724 // Used for SwapExists et al. |
724 #ifdef HAVE_SANDBOX | 725 #ifdef HAVE_SANDBOX |
725 EXTERN int sandbox INIT(= 0); | 726 EXTERN int sandbox INIT(= 0); |
726 /* Non-zero when evaluating an expression in a | 727 // Non-zero when evaluating an expression in a |
727 * "sandbox". Several things are not allowed | 728 // "sandbox". Several things are not allowed |
728 * then. */ | 729 // then. |
729 #endif | 730 #endif |
730 | 731 |
731 EXTERN int silent_mode INIT(= FALSE); | 732 EXTERN int silent_mode INIT(= FALSE); |
732 /* set to TRUE when "-s" commandline argument | 733 // set to TRUE when "-s" commandline argument |
733 * used for ex */ | 734 // used for ex |
734 | 735 |
735 EXTERN pos_T VIsual; /* start position of active Visual selection */ | 736 EXTERN pos_T VIsual; // start position of active Visual selection |
736 EXTERN int VIsual_active INIT(= FALSE); | 737 EXTERN int VIsual_active INIT(= FALSE); |
737 /* whether Visual mode is active */ | 738 // whether Visual mode is active |
738 EXTERN int VIsual_select INIT(= FALSE); | 739 EXTERN int VIsual_select INIT(= FALSE); |
739 /* whether Select mode is active */ | 740 // whether Select mode is active |
740 EXTERN int VIsual_reselect; | 741 EXTERN int VIsual_reselect; |
741 /* whether to restart the selection after a | 742 // whether to restart the selection after a |
742 * Select mode mapping or menu */ | 743 // Select mode mapping or menu |
743 | 744 |
744 EXTERN int VIsual_mode INIT(= 'v'); | 745 EXTERN int VIsual_mode INIT(= 'v'); |
745 /* type of Visual mode */ | 746 // type of Visual mode |
746 | 747 |
747 EXTERN int redo_VIsual_busy INIT(= FALSE); | 748 EXTERN int redo_VIsual_busy INIT(= FALSE); |
748 /* TRUE when redoing Visual */ | 749 // TRUE when redoing Visual |
749 | 750 |
750 #ifdef FEAT_MOUSE | 751 #ifdef FEAT_MOUSE |
751 /* | 752 /* |
752 * When pasting text with the middle mouse button in visual mode with | 753 * When pasting text with the middle mouse button in visual mode with |
753 * restart_edit set, remember where it started so we can set Insstart. | 754 * restart_edit set, remember where it started so we can set Insstart. |
805 * one indent will be removed. | 806 * one indent will be removed. |
806 */ | 807 */ |
807 EXTERN int can_si_back INIT(= FALSE); | 808 EXTERN int can_si_back INIT(= FALSE); |
808 #endif | 809 #endif |
809 | 810 |
810 EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ | 811 EXTERN pos_T saved_cursor // w_cursor before formatting text. |
811 #ifdef DO_INIT | 812 #ifdef DO_INIT |
812 = {0, 0, 0} | 813 = {0, 0, 0} |
813 #endif | 814 #endif |
814 ; | 815 ; |
815 | 816 |
816 /* | 817 /* |
817 * Stuff for insert mode. | 818 * Stuff for insert mode. |
818 */ | 819 */ |
819 EXTERN pos_T Insstart; /* This is where the latest | 820 EXTERN pos_T Insstart; // This is where the latest |
820 * insert/append mode started. */ | 821 // insert/append mode started. |
821 | 822 |
822 /* This is where the latest insert/append mode started. In contrast to | 823 /* This is where the latest insert/append mode started. In contrast to |
823 * Insstart, this won't be reset by certain keys and is needed for | 824 * Insstart, this won't be reset by certain keys and is needed for |
824 * op_insert(), to detect correctly where inserting by the user started. */ | 825 * op_insert(), to detect correctly where inserting by the user started. */ |
825 EXTERN pos_T Insstart_orig; | 826 EXTERN pos_T Insstart_orig; |
826 | 827 |
827 /* | 828 /* |
828 * Stuff for VREPLACE mode. | 829 * Stuff for VREPLACE mode. |
829 */ | 830 */ |
830 EXTERN int orig_line_count INIT(= 0); /* Line count when "gR" started */ | 831 EXTERN int orig_line_count INIT(= 0); // Line count when "gR" started |
831 EXTERN int vr_lines_changed INIT(= 0); /* #Lines changed by "gR" so far */ | 832 EXTERN int vr_lines_changed INIT(= 0); // #Lines changed by "gR" so far |
832 | 833 |
833 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) | 834 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) |
834 /* argument to SETJMP() for handling X IO errors */ | 835 /* argument to SETJMP() for handling X IO errors */ |
835 EXTERN JMP_BUF x_jump_env; | 836 EXTERN JMP_BUF x_jump_env; |
836 #endif | 837 #endif |
838 /* | 839 /* |
839 * These flags are set based upon 'fileencoding'. | 840 * These flags are set based upon 'fileencoding'. |
840 * Note that "enc_utf8" is also set for "unicode", because the characters are | 841 * Note that "enc_utf8" is also set for "unicode", because the characters are |
841 * internally stored as UTF-8 (to avoid trouble with NUL bytes). | 842 * internally stored as UTF-8 (to avoid trouble with NUL bytes). |
842 */ | 843 */ |
843 #define DBCS_JPN 932 /* japan */ | 844 #define DBCS_JPN 932 // japan |
844 #define DBCS_JPNU 9932 /* euc-jp */ | 845 #define DBCS_JPNU 9932 // euc-jp |
845 #define DBCS_KOR 949 /* korea */ | 846 #define DBCS_KOR 949 // korea |
846 #define DBCS_KORU 9949 /* euc-kr */ | 847 #define DBCS_KORU 9949 // euc-kr |
847 #define DBCS_CHS 936 /* chinese */ | 848 #define DBCS_CHS 936 // chinese |
848 #define DBCS_CHSU 9936 /* euc-cn */ | 849 #define DBCS_CHSU 9936 // euc-cn |
849 #define DBCS_CHT 950 /* taiwan */ | 850 #define DBCS_CHT 950 // taiwan |
850 #define DBCS_CHTU 9950 /* euc-tw */ | 851 #define DBCS_CHTU 9950 // euc-tw |
851 #define DBCS_2BYTE 1 /* 2byte- */ | 852 #define DBCS_2BYTE 1 // 2byte- |
852 #define DBCS_DEBUG -1 | 853 #define DBCS_DEBUG -1 |
853 | 854 |
854 EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if | 855 EXTERN int enc_dbcs INIT(= 0); // One of DBCS_xxx values if |
855 DBCS encoding */ | 856 // DBCS encoding |
856 EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */ | 857 EXTERN int enc_unicode INIT(= 0); // 2: UCS-2 or UTF-16, 4: UCS-4 |
857 EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */ | 858 EXTERN int enc_utf8 INIT(= FALSE); // UTF-8 encoded Unicode |
858 EXTERN int enc_latin1like INIT(= TRUE); /* 'encoding' is latin1 comp. */ | 859 EXTERN int enc_latin1like INIT(= TRUE); // 'encoding' is latin1 comp. |
859 #if defined(MSWIN) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD) | 860 #if defined(MSWIN) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD) |
860 /* Codepage nr of 'encoding'. Negative means it's not been set yet, zero | 861 // Codepage nr of 'encoding'. Negative means it's not been set yet, zero |
861 * means 'encoding' is not a valid codepage. */ | 862 // means 'encoding' is not a valid codepage. |
862 EXTERN int enc_codepage INIT(= -1); | 863 EXTERN int enc_codepage INIT(= -1); |
863 EXTERN int enc_latin9 INIT(= FALSE); /* 'encoding' is latin9 */ | 864 EXTERN int enc_latin9 INIT(= FALSE); // 'encoding' is latin9 |
864 #endif | 865 #endif |
865 EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */ | 866 EXTERN int has_mbyte INIT(= 0); // any multi-byte encoding |
866 | 867 |
867 /* | 868 /* |
868 * To speed up BYTELEN() we fill a table with the byte lengths whenever | 869 * To speed up BYTELEN() we fill a table with the byte lengths whenever |
869 * enc_utf8 or enc_dbcs changes. | 870 * enc_utf8 or enc_dbcs changes. |
870 */ | 871 */ |
871 EXTERN char mb_bytelen_tab[256]; | 872 EXTERN char mb_bytelen_tab[256]; |
872 | 873 |
873 /* Variables that tell what conversion is used for keyboard input and display | 874 // Variables that tell what conversion is used for keyboard input and display |
874 * output. */ | 875 // output. |
875 EXTERN vimconv_T input_conv; /* type of input conversion */ | 876 EXTERN vimconv_T input_conv; // type of input conversion |
876 EXTERN vimconv_T output_conv; /* type of output conversion */ | 877 EXTERN vimconv_T output_conv; // type of output conversion |
877 | 878 |
878 /* | 879 /* |
879 * Function pointers, used to quickly get to the right function. Each has | 880 * Function pointers, used to quickly get to the right function. Each has |
880 * three possible values: latin_ (8-bit), utfc_ or utf_ (utf-8) and dbcs_ | 881 * three possible values: latin_ (8-bit), utfc_ or utf_ (utf-8) and dbcs_ |
881 * (DBCS). | 882 * (DBCS). |
882 * The value is set in mb_init(); | 883 * The value is set in mb_init(); |
883 */ | 884 */ |
884 /* length of char in bytes, including following composing chars */ | 885 // length of char in bytes, including following composing chars |
885 EXTERN int (*mb_ptr2len)(char_u *p) INIT(= latin_ptr2len); | 886 EXTERN int (*mb_ptr2len)(char_u *p) INIT(= latin_ptr2len); |
886 /* idem, with limit on string length */ | 887 // idem, with limit on string length |
887 EXTERN int (*mb_ptr2len_len)(char_u *p, int size) INIT(= latin_ptr2len_len); | 888 EXTERN int (*mb_ptr2len_len)(char_u *p, int size) INIT(= latin_ptr2len_len); |
888 /* byte length of char */ | 889 // byte length of char |
889 EXTERN int (*mb_char2len)(int c) INIT(= latin_char2len); | 890 EXTERN int (*mb_char2len)(int c) INIT(= latin_char2len); |
890 /* convert char to bytes, return the length */ | 891 // convert char to bytes, return the length |
891 EXTERN int (*mb_char2bytes)(int c, char_u *buf) INIT(= latin_char2bytes); | 892 EXTERN int (*mb_char2bytes)(int c, char_u *buf) INIT(= latin_char2bytes); |
892 EXTERN int (*mb_ptr2cells)(char_u *p) INIT(= latin_ptr2cells); | 893 EXTERN int (*mb_ptr2cells)(char_u *p) INIT(= latin_ptr2cells); |
893 EXTERN int (*mb_ptr2cells_len)(char_u *p, int size) INIT(= latin_ptr2cells_len); | 894 EXTERN int (*mb_ptr2cells_len)(char_u *p, int size) INIT(= latin_ptr2cells_len); |
894 EXTERN int (*mb_char2cells)(int c) INIT(= latin_char2cells); | 895 EXTERN int (*mb_char2cells)(int c) INIT(= latin_char2cells); |
895 EXTERN int (*mb_off2cells)(unsigned off, unsigned max_off) INIT(= latin_off2cells); | 896 EXTERN int (*mb_off2cells)(unsigned off, unsigned max_off) INIT(= latin_off2cells); |
896 EXTERN int (*mb_ptr2char)(char_u *p) INIT(= latin_ptr2char); | 897 EXTERN int (*mb_ptr2char)(char_u *p) INIT(= latin_ptr2char); |
897 EXTERN int (*mb_head_off)(char_u *base, char_u *p) INIT(= latin_head_off); | 898 EXTERN int (*mb_head_off)(char_u *base, char_u *p) INIT(= latin_head_off); |
898 | 899 |
899 # if defined(USE_ICONV) && defined(DYNAMIC_ICONV) | 900 # if defined(USE_ICONV) && defined(DYNAMIC_ICONV) |
900 /* Pointers to functions and variables to be loaded at runtime */ | 901 // Pointers to functions and variables to be loaded at runtime |
901 EXTERN size_t (*iconv) (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); | 902 EXTERN size_t (*iconv) (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); |
902 EXTERN iconv_t (*iconv_open) (const char *tocode, const char *fromcode); | 903 EXTERN iconv_t (*iconv_open) (const char *tocode, const char *fromcode); |
903 EXTERN int (*iconv_close) (iconv_t cd); | 904 EXTERN int (*iconv_close) (iconv_t cd); |
904 EXTERN int (*iconvctl) (iconv_t cd, int request, void *argument); | 905 EXTERN int (*iconvctl) (iconv_t cd, int request, void *argument); |
905 EXTERN int* (*iconv_errno) (void); | 906 EXTERN int* (*iconv_errno) (void); |
917 * set the cursor position to the first char of the string. | 918 * set the cursor position to the first char of the string. |
918 */ | 919 */ |
919 EXTERN colnr_T preedit_start_col INIT(= MAXCOL); | 920 EXTERN colnr_T preedit_start_col INIT(= MAXCOL); |
920 EXTERN colnr_T preedit_end_col INIT(= MAXCOL); | 921 EXTERN colnr_T preedit_end_col INIT(= MAXCOL); |
921 | 922 |
922 /* "xim_changed_while_preediting" is set when changed() can set the 'modified' | 923 // "xim_changed_while_preediting" is set when changed() can set the 'modified' |
923 * flag even while preediting. */ | 924 // flag even while preediting. |
924 EXTERN int xim_changed_while_preediting INIT(= FALSE); | 925 EXTERN int xim_changed_while_preediting INIT(= FALSE); |
925 # else | 926 # else |
926 EXTERN XIC xic INIT(= NULL); | 927 EXTERN XIC xic INIT(= NULL); |
927 # endif | 928 # endif |
928 # ifdef FEAT_GUI | 929 # ifdef FEAT_GUI |
943 * "finish_op" When State is NORMAL, after typing the operator and before | 944 * "finish_op" When State is NORMAL, after typing the operator and before |
944 * typing the motion command. | 945 * typing the motion command. |
945 * "motion_force" Last motion_force from do_pending_operator() | 946 * "motion_force" Last motion_force from do_pending_operator() |
946 * "debug_mode" Debug mode. | 947 * "debug_mode" Debug mode. |
947 */ | 948 */ |
948 EXTERN int State INIT(= NORMAL); /* This is the current state of the | 949 EXTERN int State INIT(= NORMAL); // This is the current state of the |
949 * command interpreter. */ | 950 // command interpreter. |
950 #ifdef FEAT_EVAL | 951 #ifdef FEAT_EVAL |
951 EXTERN int debug_mode INIT(= FALSE); | 952 EXTERN int debug_mode INIT(= FALSE); |
952 #endif | 953 #endif |
953 | 954 |
954 EXTERN int finish_op INIT(= FALSE);/* TRUE while an operator is pending */ | 955 EXTERN int finish_op INIT(= FALSE);// TRUE while an operator is pending |
955 EXTERN long opcount INIT(= 0); /* count for pending operator */ | 956 EXTERN long opcount INIT(= 0); // count for pending operator |
956 EXTERN int motion_force INIT(= 0); // motion force for pending operator | 957 EXTERN int motion_force INIT(= 0); // motion force for pending operator |
957 | 958 |
958 /* | 959 /* |
959 * Ex mode (Q) state | 960 * Ex mode (Q) state |
960 */ | 961 */ |
961 EXTERN int exmode_active INIT(= 0); /* zero, EXMODE_NORMAL or EXMODE_VIM */ | 962 EXTERN int exmode_active INIT(= 0); // zero, EXMODE_NORMAL or EXMODE_VIM |
962 EXTERN int ex_no_reprint INIT(= FALSE); /* no need to print after z or p */ | 963 EXTERN int ex_no_reprint INIT(= FALSE); // no need to print after z or p |
963 | 964 |
964 EXTERN int reg_recording INIT(= 0); /* register for recording or zero */ | 965 EXTERN int reg_recording INIT(= 0); // register for recording or zero |
965 EXTERN int reg_executing INIT(= 0); /* register being executed or zero */ | 966 EXTERN int reg_executing INIT(= 0); // register being executed or zero |
966 | 967 |
967 EXTERN int no_mapping INIT(= FALSE); /* currently no mapping allowed */ | 968 EXTERN int no_mapping INIT(= FALSE); // currently no mapping allowed |
968 EXTERN int no_zero_mapping INIT(= 0); /* mapping zero not allowed */ | 969 EXTERN int no_zero_mapping INIT(= 0); // mapping zero not allowed |
969 EXTERN int allow_keys INIT(= FALSE); /* allow key codes when no_mapping | 970 EXTERN int allow_keys INIT(= FALSE); // allow key codes when no_mapping |
970 * is set */ | 971 // is set |
971 EXTERN int no_u_sync INIT(= 0); /* Don't call u_sync() */ | 972 EXTERN int no_u_sync INIT(= 0); // Don't call u_sync() |
972 #ifdef FEAT_EVAL | 973 #ifdef FEAT_EVAL |
973 EXTERN int u_sync_once INIT(= 0); /* Call u_sync() once when evaluating | 974 EXTERN int u_sync_once INIT(= 0); // Call u_sync() once when evaluating |
974 an expression. */ | 975 // an expression. |
975 #endif | 976 #endif |
976 | 977 |
977 EXTERN int restart_edit INIT(= 0); /* call edit when next cmd finished */ | 978 EXTERN int restart_edit INIT(= 0); // call edit when next cmd finished |
978 EXTERN int arrow_used; /* Normally FALSE, set to TRUE after | 979 EXTERN int arrow_used; // Normally FALSE, set to TRUE after |
979 * hitting cursor key in insert mode. | 980 // hitting cursor key in insert mode. |
980 * Used by vgetorpeek() to decide when | 981 // Used by vgetorpeek() to decide when |
981 * to call u_sync() */ | 982 // to call u_sync() |
982 EXTERN int ins_at_eol INIT(= FALSE); /* put cursor after eol when | 983 EXTERN int ins_at_eol INIT(= FALSE); // put cursor after eol when |
983 restarting edit after CTRL-O */ | 984 // restarting edit after CTRL-O |
984 #ifdef FEAT_INS_EXPAND | 985 #ifdef FEAT_INS_EXPAND |
985 EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */ | 986 EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode |
986 EXTERN char_u *edit_submode_pre INIT(= NULL); /* prepended to edit_submode */ | 987 EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode |
987 EXTERN char_u *edit_submode_extra INIT(= NULL);/* appended to edit_submode */ | 988 EXTERN char_u *edit_submode_extra INIT(= NULL);// appended to edit_submode |
988 EXTERN hlf_T edit_submode_highl; /* highl. method for extra info */ | 989 EXTERN hlf_T edit_submode_highl; // highl. method for extra info |
989 #endif | 990 #endif |
990 | 991 |
991 EXTERN int no_abbr INIT(= TRUE); /* TRUE when no abbreviations loaded */ | 992 EXTERN int no_abbr INIT(= TRUE); // TRUE when no abbreviations loaded |
992 | 993 |
993 #ifdef USE_EXE_NAME | 994 #ifdef USE_EXE_NAME |
994 EXTERN char_u *exe_name; /* the name of the executable */ | 995 EXTERN char_u *exe_name; // the name of the executable |
995 #endif | 996 #endif |
996 | 997 |
997 #ifdef USE_ON_FLY_SCROLL | 998 #ifdef USE_ON_FLY_SCROLL |
998 EXTERN int dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */ | 999 EXTERN int dont_scroll INIT(= FALSE);// don't use scrollbars when TRUE |
999 #endif | 1000 #endif |
1000 EXTERN int mapped_ctrl_c INIT(= FALSE); /* modes where CTRL-C is mapped */ | 1001 EXTERN int mapped_ctrl_c INIT(= FALSE); // modes where CTRL-C is mapped |
1001 EXTERN int ctrl_c_interrupts INIT(= TRUE); /* CTRL-C sets got_int */ | 1002 EXTERN int ctrl_c_interrupts INIT(= TRUE); // CTRL-C sets got_int |
1002 | 1003 |
1003 EXTERN cmdmod_T cmdmod; /* Ex command modifiers */ | 1004 EXTERN cmdmod_T cmdmod; // Ex command modifiers |
1004 | 1005 |
1005 EXTERN int msg_silent INIT(= 0); /* don't print messages */ | 1006 EXTERN int msg_silent INIT(= 0); // don't print messages |
1006 EXTERN int emsg_silent INIT(= 0); /* don't print error messages */ | 1007 EXTERN int emsg_silent INIT(= 0); // don't print error messages |
1007 EXTERN int emsg_noredir INIT(= 0); /* don't redirect error messages */ | 1008 EXTERN int emsg_noredir INIT(= 0); // don't redirect error messages |
1008 EXTERN int cmd_silent INIT(= FALSE); /* don't echo the command line */ | 1009 EXTERN int cmd_silent INIT(= FALSE); // don't echo the command line |
1009 | 1010 |
1010 EXTERN int swap_exists_action INIT(= SEA_NONE); | 1011 EXTERN int swap_exists_action INIT(= SEA_NONE); |
1011 /* For dialog when swap file already | 1012 // For dialog when swap file already |
1012 * exists. */ | 1013 // exists. |
1013 EXTERN int swap_exists_did_quit INIT(= FALSE); | 1014 EXTERN int swap_exists_did_quit INIT(= FALSE); |
1014 /* Selected "quit" at the dialog. */ | 1015 // Selected "quit" at the dialog. |
1015 | 1016 |
1016 EXTERN char_u *IObuff; /* sprintf's are done in this buffer, | 1017 EXTERN char_u *IObuff; // sprintf's are done in this buffer, |
1017 size is IOSIZE */ | 1018 // size is IOSIZE |
1018 EXTERN char_u *NameBuff; /* file names are expanded in this | 1019 EXTERN char_u *NameBuff; // file names are expanded in this |
1019 * buffer, size is MAXPATHL */ | 1020 // buffer, size is MAXPATHL |
1020 EXTERN char msg_buf[MSG_BUF_LEN]; /* small buffer for messages */ | 1021 EXTERN char msg_buf[MSG_BUF_LEN]; // small buffer for messages |
1021 | 1022 |
1022 /* When non-zero, postpone redrawing. */ | 1023 // When non-zero, postpone redrawing. |
1023 EXTERN int RedrawingDisabled INIT(= 0); | 1024 EXTERN int RedrawingDisabled INIT(= 0); |
1024 | 1025 |
1025 EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */ | 1026 EXTERN int readonlymode INIT(= FALSE); // Set to TRUE for "view" |
1026 EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */ | 1027 EXTERN int recoverymode INIT(= FALSE); // Set to TRUE for "-r" option |
1027 | 1028 |
1028 EXTERN typebuf_T typebuf /* typeahead buffer */ | 1029 EXTERN typebuf_T typebuf // typeahead buffer |
1029 #ifdef DO_INIT | 1030 #ifdef DO_INIT |
1030 = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} | 1031 = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} |
1031 #endif | 1032 #endif |
1032 ; | 1033 ; |
1033 EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */ | 1034 EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal() |
1034 EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */ | 1035 EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal() |
1035 #ifdef FEAT_EVAL | 1036 #ifdef FEAT_EVAL |
1036 EXTERN int ignore_script INIT(= FALSE); /* ignore script input */ | 1037 EXTERN int ignore_script INIT(= FALSE); // ignore script input |
1037 #endif | 1038 #endif |
1038 EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */ | 1039 EXTERN int stop_insert_mode; // for ":stopinsert" and 'insertmode' |
1039 | 1040 |
1040 EXTERN int KeyTyped; /* TRUE if user typed current char */ | 1041 EXTERN int KeyTyped; // TRUE if user typed current char |
1041 EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */ | 1042 EXTERN int KeyStuffed; // TRUE if current char from stuffbuf |
1042 #ifdef HAVE_INPUT_METHOD | 1043 #ifdef HAVE_INPUT_METHOD |
1043 EXTERN int vgetc_im_active; /* Input Method was active for last | 1044 EXTERN int vgetc_im_active; // Input Method was active for last |
1044 character obtained from vgetc() */ | 1045 // character obtained from vgetc() |
1045 #endif | 1046 #endif |
1046 EXTERN int maptick INIT(= 0); /* tick for each non-mapped char */ | 1047 EXTERN int maptick INIT(= 0); // tick for each non-mapped char |
1047 | 1048 |
1048 EXTERN int must_redraw INIT(= 0); /* type of redraw necessary */ | 1049 EXTERN int must_redraw INIT(= 0); // type of redraw necessary |
1049 EXTERN int skip_redraw INIT(= FALSE); /* skip redraw once */ | 1050 EXTERN int skip_redraw INIT(= FALSE); // skip redraw once |
1050 EXTERN int do_redraw INIT(= FALSE); /* extra redraw once */ | 1051 EXTERN int do_redraw INIT(= FALSE); // extra redraw once |
1051 | 1052 |
1052 EXTERN int need_highlight_changed INIT(= TRUE); | 1053 EXTERN int need_highlight_changed INIT(= TRUE); |
1053 | 1054 |
1054 #define NSCRIPT 15 | 1055 #define NSCRIPT 15 |
1055 EXTERN FILE *scriptin[NSCRIPT]; /* streams to read script from */ | 1056 EXTERN FILE *scriptin[NSCRIPT]; // streams to read script from |
1056 EXTERN int curscript INIT(= 0); /* index in scriptin[] */ | 1057 EXTERN int curscript INIT(= 0); // index in scriptin[] |
1057 EXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */ | 1058 EXTERN FILE *scriptout INIT(= NULL); // stream to write script to |
1058 EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */ | 1059 EXTERN int read_cmd_fd INIT(= 0); // fd to read commands from |
1059 | 1060 |
1060 /* volatile because it is used in signal handler catch_sigint(). */ | 1061 // volatile because it is used in signal handler catch_sigint(). |
1061 EXTERN volatile sig_atomic_t got_int INIT(= FALSE); /* set to TRUE when interrupt | 1062 EXTERN volatile sig_atomic_t got_int INIT(= FALSE); // set to TRUE when interrupt |
1062 signal occurred */ | 1063 // signal occurred |
1063 #ifdef USE_TERM_CONSOLE | 1064 #ifdef USE_TERM_CONSOLE |
1064 EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */ | 1065 EXTERN int term_console INIT(= FALSE); // set to TRUE when console used |
1065 #endif | 1066 #endif |
1066 EXTERN int termcap_active INIT(= FALSE); /* set by starttermcap() */ | 1067 EXTERN int termcap_active INIT(= FALSE); // set by starttermcap() |
1067 EXTERN int cur_tmode INIT(= TMODE_COOK); /* input terminal mode */ | 1068 EXTERN int cur_tmode INIT(= TMODE_COOK); // input terminal mode |
1068 EXTERN int bangredo INIT(= FALSE); /* set to TRUE with ! command */ | 1069 EXTERN int bangredo INIT(= FALSE); // set to TRUE with ! command |
1069 EXTERN int searchcmdlen; /* length of previous search cmd */ | 1070 EXTERN int searchcmdlen; // length of previous search cmd |
1070 #ifdef FEAT_SYN_HL | 1071 #ifdef FEAT_SYN_HL |
1071 EXTERN int reg_do_extmatch INIT(= 0); /* Used when compiling regexp: | 1072 EXTERN int reg_do_extmatch INIT(= 0); // Used when compiling regexp: |
1072 * REX_SET to allow \z\(...\), | 1073 // REX_SET to allow \z\(...\), |
1073 * REX_USE to allow \z\1 et al. */ | 1074 // REX_USE to allow \z\1 et al. |
1074 EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL); /* Used by vim_regexec(): | 1075 EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL); // Used by vim_regexec(): |
1075 * strings for \z\1...\z\9 */ | 1076 // strings for \z\1...\z\9 |
1076 EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL); /* Set by vim_regexec() | 1077 EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL); // Set by vim_regexec() |
1077 * to store \z\(...\) matches */ | 1078 // to store \z\(...\) matches |
1078 #endif | 1079 #endif |
1079 | 1080 |
1080 EXTERN int did_outofmem_msg INIT(= FALSE); | 1081 EXTERN int did_outofmem_msg INIT(= FALSE); |
1081 /* set after out of memory msg */ | 1082 // set after out of memory msg |
1082 EXTERN int did_swapwrite_msg INIT(= FALSE); | 1083 EXTERN int did_swapwrite_msg INIT(= FALSE); |
1083 /* set after swap write error msg */ | 1084 // set after swap write error msg |
1084 EXTERN int undo_off INIT(= FALSE); /* undo switched off for now */ | 1085 EXTERN int undo_off INIT(= FALSE); // undo switched off for now |
1085 EXTERN int global_busy INIT(= 0); /* set when :global is executing */ | 1086 EXTERN int global_busy INIT(= 0); // set when :global is executing |
1086 EXTERN int listcmd_busy INIT(= FALSE); /* set when :argdo, :windo or | 1087 EXTERN int listcmd_busy INIT(= FALSE); // set when :argdo, :windo or |
1087 :bufdo is executing */ | 1088 // :bufdo is executing |
1088 EXTERN int need_start_insertmode INIT(= FALSE); | 1089 EXTERN int need_start_insertmode INIT(= FALSE); |
1089 /* start insert mode soon */ | 1090 // start insert mode soon |
1090 EXTERN char_u *last_cmdline INIT(= NULL); /* last command line (for ":) */ | 1091 EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":) |
1091 EXTERN char_u *repeat_cmdline INIT(= NULL); /* command line for "." */ | 1092 EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "." |
1092 #ifdef FEAT_CMDHIST | 1093 #ifdef FEAT_CMDHIST |
1093 EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */ | 1094 EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline |
1094 #endif | 1095 #endif |
1095 EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */ | 1096 EXTERN char_u *autocmd_fname INIT(= NULL); // fname for <afile> on cmdline |
1096 EXTERN int autocmd_fname_full; /* autocmd_fname is full path */ | 1097 EXTERN int autocmd_fname_full; // autocmd_fname is full path |
1097 EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */ | 1098 EXTERN int autocmd_bufnr INIT(= 0); // fnum for <abuf> on cmdline |
1098 EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */ | 1099 EXTERN char_u *autocmd_match INIT(= NULL); // name for <amatch> on cmdline |
1099 EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */ | 1100 EXTERN int did_cursorhold INIT(= FALSE); // set when CursorHold t'gerd |
1100 EXTERN pos_T last_cursormoved /* for CursorMoved event */ | 1101 EXTERN pos_T last_cursormoved // for CursorMoved event |
1101 # ifdef DO_INIT | 1102 # ifdef DO_INIT |
1102 = {0, 0, 0} | 1103 = {0, 0, 0} |
1103 # endif | 1104 # endif |
1104 ; | 1105 ; |
1105 | 1106 |
1106 EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */ | 1107 EXTERN int postponed_split INIT(= 0); // for CTRL-W CTRL-] command |
1107 EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */ | 1108 EXTERN int postponed_split_flags INIT(= 0); // args for win_split() |
1108 EXTERN int postponed_split_tab INIT(= 0); /* cmdmod.tab */ | 1109 EXTERN int postponed_split_tab INIT(= 0); // cmdmod.tab |
1109 #ifdef FEAT_QUICKFIX | 1110 #ifdef FEAT_QUICKFIX |
1110 EXTERN int g_do_tagpreview INIT(= 0); // for tag preview commands: | 1111 EXTERN int g_do_tagpreview INIT(= 0); // for tag preview commands: |
1111 // height of preview window | 1112 // height of preview window |
1112 #endif | 1113 #endif |
1113 EXTERN int g_tag_at_cursor INIT(= FALSE); // whether the tag command comes | 1114 EXTERN int g_tag_at_cursor INIT(= FALSE); // whether the tag command comes |
1114 // from the command line (0) or was | 1115 // from the command line (0) or was |
1115 // invoked as a normal command (1) | 1116 // invoked as a normal command (1) |
1116 | 1117 |
1117 EXTERN int replace_offset INIT(= 0); /* offset for replace_push() */ | 1118 EXTERN int replace_offset INIT(= 0); // offset for replace_push() |
1118 | 1119 |
1119 EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|"); | 1120 EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|"); |
1120 /* need backslash in cmd line */ | 1121 // need backslash in cmd line |
1121 | 1122 |
1122 EXTERN int keep_help_flag INIT(= FALSE); /* doing :ta from help file */ | 1123 EXTERN int keep_help_flag INIT(= FALSE); // doing :ta from help file |
1123 | 1124 |
1124 /* | 1125 /* |
1125 * When a string option is NULL (which only happens in out-of-memory | 1126 * When a string option is NULL (which only happens in out-of-memory |
1126 * situations), it is set to empty_option, to avoid having to check for NULL | 1127 * situations), it is set to empty_option, to avoid having to check for NULL |
1127 * everywhere. | 1128 * everywhere. |
1128 */ | 1129 */ |
1129 EXTERN char_u *empty_option INIT(= (char_u *)""); | 1130 EXTERN char_u *empty_option INIT(= (char_u *)""); |
1130 | 1131 |
1131 EXTERN int redir_off INIT(= FALSE); /* no redirection for a moment */ | 1132 EXTERN int redir_off INIT(= FALSE); // no redirection for a moment |
1132 EXTERN FILE *redir_fd INIT(= NULL); /* message redirection file */ | 1133 EXTERN FILE *redir_fd INIT(= NULL); // message redirection file |
1133 #ifdef FEAT_EVAL | 1134 #ifdef FEAT_EVAL |
1134 EXTERN int redir_reg INIT(= 0); /* message redirection register */ | 1135 EXTERN int redir_reg INIT(= 0); // message redirection register |
1135 EXTERN int redir_vname INIT(= 0); /* message redirection variable */ | 1136 EXTERN int redir_vname INIT(= 0); // message redirection variable |
1136 EXTERN int redir_execute INIT(= 0); /* execute() redirection */ | 1137 EXTERN int redir_execute INIT(= 0); // execute() redirection |
1137 #endif | 1138 #endif |
1138 | 1139 |
1139 #ifdef FEAT_LANGMAP | 1140 #ifdef FEAT_LANGMAP |
1140 EXTERN char_u langmap_mapchar[256]; /* mapping for language keys */ | 1141 EXTERN char_u langmap_mapchar[256]; // mapping for language keys |
1141 #endif | 1142 #endif |
1142 | 1143 |
1143 #ifdef FEAT_WILDMENU | 1144 #ifdef FEAT_WILDMENU |
1144 EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */ | 1145 EXTERN int save_p_ls INIT(= -1); // Save 'laststatus' setting |
1145 EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */ | 1146 EXTERN int save_p_wmh INIT(= -1); // Save 'winminheight' setting |
1146 EXTERN int wild_menu_showing INIT(= 0); | 1147 EXTERN int wild_menu_showing INIT(= 0); |
1147 # define WM_SHOWN 1 /* wildmenu showing */ | 1148 # define WM_SHOWN 1 // wildmenu showing |
1148 # define WM_SCROLLED 2 /* wildmenu showing with scroll */ | 1149 # define WM_SCROLLED 2 // wildmenu showing with scroll |
1149 #endif | 1150 #endif |
1150 | 1151 |
1151 #ifdef MSWIN | 1152 #ifdef MSWIN |
1152 EXTERN char_u toupper_tab[256]; /* table for toupper() */ | 1153 EXTERN char_u toupper_tab[256]; // table for toupper() |
1153 EXTERN char_u tolower_tab[256]; /* table for tolower() */ | 1154 EXTERN char_u tolower_tab[256]; // table for tolower() |
1154 #endif | 1155 #endif |
1155 | 1156 |
1156 #ifdef FEAT_LINEBREAK | 1157 #ifdef FEAT_LINEBREAK |
1157 EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */ | 1158 EXTERN char breakat_flags[256]; // which characters are in 'breakat' |
1158 #endif | 1159 #endif |
1159 | 1160 |
1160 /* These are in version.c, call init_longVersion() before use. */ | 1161 // These are in version.c, call init_longVersion() before use. |
1161 extern char *Version; | 1162 extern char *Version; |
1162 #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC) | 1163 #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC) |
1163 extern char longVersion[]; | 1164 extern char longVersion[]; |
1164 #else | 1165 #else |
1165 EXTERN char *longVersion; | 1166 EXTERN char *longVersion; |
1180 # endif | 1181 # endif |
1181 extern char_u *compiled_user; | 1182 extern char_u *compiled_user; |
1182 extern char_u *compiled_sys; | 1183 extern char_u *compiled_sys; |
1183 #endif | 1184 #endif |
1184 | 1185 |
1185 /* When a window has a local directory, the absolute path of the global | 1186 // When a window has a local directory, the absolute path of the global |
1186 * current directory is stored here (in allocated memory). If the current | 1187 // current directory is stored here (in allocated memory). If the current |
1187 * directory is not a local directory, globaldir is NULL. */ | 1188 // directory is not a local directory, globaldir is NULL. |
1188 EXTERN char_u *globaldir INIT(= NULL); | 1189 EXTERN char_u *globaldir INIT(= NULL); |
1189 | 1190 |
1190 /* Characters from 'listchars' option */ | 1191 // Characters from 'listchars' option |
1191 EXTERN int lcs_eol INIT(= '$'); | 1192 EXTERN int lcs_eol INIT(= '$'); |
1192 EXTERN int lcs_ext INIT(= NUL); | 1193 EXTERN int lcs_ext INIT(= NUL); |
1193 EXTERN int lcs_prec INIT(= NUL); | 1194 EXTERN int lcs_prec INIT(= NUL); |
1194 EXTERN int lcs_nbsp INIT(= NUL); | 1195 EXTERN int lcs_nbsp INIT(= NUL); |
1195 EXTERN int lcs_space INIT(= NUL); | 1196 EXTERN int lcs_space INIT(= NUL); |
1199 EXTERN int lcs_trail INIT(= NUL); | 1200 EXTERN int lcs_trail INIT(= NUL); |
1200 #ifdef FEAT_CONCEAL | 1201 #ifdef FEAT_CONCEAL |
1201 EXTERN int lcs_conceal INIT(= ' '); | 1202 EXTERN int lcs_conceal INIT(= ' '); |
1202 #endif | 1203 #endif |
1203 | 1204 |
1204 /* Characters from 'fillchars' option */ | 1205 // Characters from 'fillchars' option |
1205 EXTERN int fill_stl INIT(= ' '); | 1206 EXTERN int fill_stl INIT(= ' '); |
1206 EXTERN int fill_stlnc INIT(= ' '); | 1207 EXTERN int fill_stlnc INIT(= ' '); |
1207 EXTERN int fill_vert INIT(= ' '); | 1208 EXTERN int fill_vert INIT(= ' '); |
1208 EXTERN int fill_fold INIT(= '-'); | 1209 EXTERN int fill_fold INIT(= '-'); |
1209 EXTERN int fill_diff INIT(= '-'); | 1210 EXTERN int fill_diff INIT(= '-'); |
1210 | 1211 |
1211 #ifdef FEAT_FOLDING | 1212 #ifdef FEAT_FOLDING |
1212 EXTERN int disable_fold_update INIT(= 0); | 1213 EXTERN int disable_fold_update INIT(= 0); |
1213 #endif | 1214 #endif |
1214 | 1215 |
1215 /* Whether 'keymodel' contains "stopsel" and "startsel". */ | 1216 // Whether 'keymodel' contains "stopsel" and "startsel". |
1216 EXTERN int km_stopsel INIT(= FALSE); | 1217 EXTERN int km_stopsel INIT(= FALSE); |
1217 EXTERN int km_startsel INIT(= FALSE); | 1218 EXTERN int km_startsel INIT(= FALSE); |
1218 | 1219 |
1219 #ifdef FEAT_CMDWIN | 1220 #ifdef FEAT_CMDWIN |
1220 EXTERN int cedit_key INIT(= -1); /* key value of 'cedit' option */ | 1221 EXTERN int cedit_key INIT(= -1); // key value of 'cedit' option |
1221 EXTERN int cmdwin_type INIT(= 0); /* type of cmdline window or 0 */ | 1222 EXTERN int cmdwin_type INIT(= 0); // type of cmdline window or 0 |
1222 EXTERN int cmdwin_result INIT(= 0); /* result of cmdline window or 0 */ | 1223 EXTERN int cmdwin_result INIT(= 0); // result of cmdline window or 0 |
1223 #endif | 1224 #endif |
1224 | 1225 |
1225 EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--")); | 1226 EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--")); |
1226 | 1227 |
1227 /* | 1228 /* |
1228 * When ":global" is used to number of substitutions and changed lines is | 1229 * When ":global" is used to number of substitutions and changed lines is |
1229 * accumulated until it's finished. | 1230 * accumulated until it's finished. |
1230 * Also used for ":spellrepall". | 1231 * Also used for ":spellrepall". |
1231 */ | 1232 */ |
1232 EXTERN long sub_nsubs; /* total number of substitutions */ | 1233 EXTERN long sub_nsubs; // total number of substitutions |
1233 EXTERN linenr_T sub_nlines; /* total number of lines changed */ | 1234 EXTERN linenr_T sub_nlines; // total number of lines changed |
1234 | 1235 |
1235 /* table to store parsed 'wildmode' */ | 1236 // table to store parsed 'wildmode' |
1236 EXTERN char_u wim_flags[4]; | 1237 EXTERN char_u wim_flags[4]; |
1237 | 1238 |
1238 #if defined(FEAT_TITLE) && defined(FEAT_STL_OPT) | 1239 #if defined(FEAT_TITLE) && defined(FEAT_STL_OPT) |
1239 /* whether titlestring and iconstring contains statusline syntax */ | 1240 // whether titlestring and iconstring contains statusline syntax |
1240 # define STL_IN_ICON 1 | 1241 # define STL_IN_ICON 1 |
1241 # define STL_IN_TITLE 2 | 1242 # define STL_IN_TITLE 2 |
1242 EXTERN int stl_syntax INIT(= 0); | 1243 EXTERN int stl_syntax INIT(= 0); |
1243 #endif | 1244 #endif |
1244 | 1245 |
1245 #ifdef FEAT_SEARCH_EXTRA | 1246 #ifdef FEAT_SEARCH_EXTRA |
1246 /* don't use 'hlsearch' temporarily */ | 1247 // don't use 'hlsearch' temporarily |
1247 EXTERN int no_hlsearch INIT(= FALSE); | 1248 EXTERN int no_hlsearch INIT(= FALSE); |
1248 #endif | 1249 #endif |
1249 | 1250 |
1250 #if defined(FEAT_BEVAL) && !defined(NO_X11_INCLUDES) | 1251 #if defined(FEAT_BEVAL) && !defined(NO_X11_INCLUDES) |
1251 EXTERN BalloonEval *balloonEval INIT(= NULL); | 1252 EXTERN BalloonEval *balloonEval INIT(= NULL); |
1255 # define BEVAL_NETBEANS 0x01 | 1256 # define BEVAL_NETBEANS 0x01 |
1256 # endif | 1257 # endif |
1257 #endif | 1258 #endif |
1258 | 1259 |
1259 #ifdef CURSOR_SHAPE | 1260 #ifdef CURSOR_SHAPE |
1260 /* the table is in misc2.c, because of initializations */ | 1261 // the table is in misc2.c, because of initializations |
1261 extern cursorentry_T shape_table[SHAPE_IDX_COUNT]; | 1262 extern cursorentry_T shape_table[SHAPE_IDX_COUNT]; |
1262 #endif | 1263 #endif |
1263 | 1264 |
1264 #ifdef FEAT_PRINTER | 1265 #ifdef FEAT_PRINTER |
1265 /* | 1266 /* |
1302 {"formfeed", FALSE, 0, NULL, 0, FALSE}, | 1303 {"formfeed", FALSE, 0, NULL, 0, FALSE}, |
1303 } | 1304 } |
1304 # endif | 1305 # endif |
1305 ; | 1306 ; |
1306 | 1307 |
1307 /* For prt_get_unit(). */ | 1308 // For prt_get_unit(). |
1308 # define PRT_UNIT_NONE -1 | 1309 # define PRT_UNIT_NONE -1 |
1309 # define PRT_UNIT_PERC 0 | 1310 # define PRT_UNIT_PERC 0 |
1310 # define PRT_UNIT_INCH 1 | 1311 # define PRT_UNIT_INCH 1 |
1311 # define PRT_UNIT_MM 2 | 1312 # define PRT_UNIT_MM 2 |
1312 # define PRT_UNIT_POINT 3 | 1313 # define PRT_UNIT_POINT 3 |
1313 # define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"} | 1314 # define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"} |
1314 #endif | 1315 #endif |
1315 | 1316 |
1316 #if (defined(FEAT_PRINTER) && defined(FEAT_STL_OPT)) \ | 1317 #if (defined(FEAT_PRINTER) && defined(FEAT_STL_OPT)) \ |
1317 || defined(FEAT_GUI_TABLINE) | 1318 || defined(FEAT_GUI_TABLINE) |
1318 /* Page number used for %N in 'pageheader' and 'guitablabel'. */ | 1319 // Page number used for %N in 'pageheader' and 'guitablabel'. |
1319 EXTERN linenr_T printer_page_num; | 1320 EXTERN linenr_T printer_page_num; |
1320 #endif | 1321 #endif |
1321 | 1322 |
1322 #ifdef FEAT_XCLIPBOARD | 1323 #ifdef FEAT_XCLIPBOARD |
1323 // xterm display name | 1324 // xterm display name |
1333 EXTERN XtAppContext app_context INIT(= (XtAppContext)NULL); | 1334 EXTERN XtAppContext app_context INIT(= (XtAppContext)NULL); |
1334 #endif | 1335 #endif |
1335 | 1336 |
1336 #ifdef FEAT_GUI_GTK | 1337 #ifdef FEAT_GUI_GTK |
1337 EXTERN guint32 gtk_socket_id INIT(= 0); | 1338 EXTERN guint32 gtk_socket_id INIT(= 0); |
1338 EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */ | 1339 EXTERN int echo_wid_arg INIT(= FALSE); // --echo-wid argument |
1339 #endif | 1340 #endif |
1340 | 1341 |
1341 #ifdef FEAT_GUI_MSWIN | 1342 #ifdef FEAT_GUI_MSWIN |
1342 /* | 1343 /* |
1343 * The value of the --windowid argument. | 1344 * The value of the --windowid argument. |
1345 */ | 1346 */ |
1346 EXTERN long_u win_socket_id INIT(= 0); | 1347 EXTERN long_u win_socket_id INIT(= 0); |
1347 #endif | 1348 #endif |
1348 | 1349 |
1349 #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) | 1350 #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) |
1350 EXTERN int typebuf_was_filled INIT(= FALSE); /* received text from client | 1351 EXTERN int typebuf_was_filled INIT(= FALSE); // received text from client |
1351 or from feedkeys() */ | 1352 // or from feedkeys() |
1352 #endif | 1353 #endif |
1353 | 1354 |
1354 #ifdef FEAT_CLIENTSERVER | 1355 #ifdef FEAT_CLIENTSERVER |
1355 EXTERN char_u *serverName INIT(= NULL); /* name of the server */ | 1356 EXTERN char_u *serverName INIT(= NULL); // name of the server |
1356 # ifdef FEAT_X11 | 1357 # ifdef FEAT_X11 |
1357 EXTERN Window commWindow INIT(= None); | 1358 EXTERN Window commWindow INIT(= None); |
1358 EXTERN Window clientWindow INIT(= None); | 1359 EXTERN Window clientWindow INIT(= None); |
1359 EXTERN Atom commProperty INIT(= None); | 1360 EXTERN Atom commProperty INIT(= None); |
1360 EXTERN char_u *serverDelayedStartName INIT(= NULL); | 1361 EXTERN char_u *serverDelayedStartName INIT(= NULL); |
1365 EXTERN HWND clientWindow INIT(= 0); | 1366 EXTERN HWND clientWindow INIT(= 0); |
1366 # endif | 1367 # endif |
1367 #endif | 1368 #endif |
1368 | 1369 |
1369 #if defined(UNIX) || defined(VMS) | 1370 #if defined(UNIX) || defined(VMS) |
1370 EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */ | 1371 EXTERN int term_is_xterm INIT(= FALSE); // xterm-like 'term' |
1371 #endif | 1372 #endif |
1372 | 1373 |
1373 #ifdef BACKSLASH_IN_FILENAME | 1374 #ifdef BACKSLASH_IN_FILENAME |
1374 EXTERN char psepc INIT(= '\\'); /* normal path separator character */ | 1375 EXTERN char psepc INIT(= '\\'); // normal path separator character |
1375 EXTERN char psepcN INIT(= '/'); /* abnormal path separator character */ | 1376 EXTERN char psepcN INIT(= '/'); // abnormal path separator character |
1376 /* normal path separator string */ | 1377 /* normal path separator string */ |
1377 EXTERN char pseps[2] INIT(= {'\\' COMMA 0}); | 1378 EXTERN char pseps[2] INIT(= {'\\' COMMA 0}); |
1378 #endif | 1379 #endif |
1379 | 1380 |
1380 /* Set to TRUE when an operator is being executed with virtual editing, MAYBE | 1381 // Set to TRUE when an operator is being executed with virtual editing, MAYBE |
1381 * when no operator is being executed, FALSE otherwise. */ | 1382 // when no operator is being executed, FALSE otherwise. |
1382 EXTERN int virtual_op INIT(= MAYBE); | 1383 EXTERN int virtual_op INIT(= MAYBE); |
1383 | 1384 |
1384 #ifdef FEAT_SYN_HL | 1385 #ifdef FEAT_SYN_HL |
1385 /* Display tick, incremented for each call to update_screen() */ | 1386 // Display tick, incremented for each call to update_screen() |
1386 EXTERN disptick_T display_tick INIT(= 0); | 1387 EXTERN disptick_T display_tick INIT(= 0); |
1387 #endif | 1388 #endif |
1388 | 1389 |
1389 #ifdef FEAT_SPELL | 1390 #ifdef FEAT_SPELL |
1390 /* Line in which spell checking wasn't highlighted because it touched the | 1391 // Line in which spell checking wasn't highlighted because it touched the |
1391 * cursor position in Insert mode. */ | 1392 // cursor position in Insert mode. |
1392 EXTERN linenr_T spell_redraw_lnum INIT(= 0); | 1393 EXTERN linenr_T spell_redraw_lnum INIT(= 0); |
1393 #endif | 1394 #endif |
1394 | 1395 |
1395 #ifdef FEAT_CONCEAL | 1396 #ifdef FEAT_CONCEAL |
1396 /* Set when the cursor line needs to be redrawn. */ | 1397 // Set when the cursor line needs to be redrawn. |
1397 EXTERN int need_cursor_line_redraw INIT(= FALSE); | 1398 EXTERN int need_cursor_line_redraw INIT(= FALSE); |
1398 #endif | 1399 #endif |
1399 | 1400 |
1400 #ifdef USE_MCH_ERRMSG | 1401 #ifdef USE_MCH_ERRMSG |
1401 /* Grow array to collect error messages in until they can be displayed. */ | 1402 // Grow array to collect error messages in until they can be displayed. |
1402 EXTERN garray_T error_ga | 1403 EXTERN garray_T error_ga |
1403 # ifdef DO_INIT | 1404 # ifdef DO_INIT |
1404 = {0, 0, 0, 0, NULL} | 1405 = {0, 0, 0, 0, NULL} |
1405 # endif | 1406 # endif |
1406 ; | 1407 ; |
1407 #endif | 1408 #endif |
1408 | 1409 |
1409 #ifdef FEAT_NETBEANS_INTG | 1410 #ifdef FEAT_NETBEANS_INTG |
1410 EXTERN char *netbeansArg INIT(= NULL); /* the -nb[:host:port:passwd] arg */ | 1411 EXTERN char *netbeansArg INIT(= NULL); // the -nb[:host:port:passwd] arg |
1411 EXTERN int netbeansFireChanges INIT(= 1); /* send buffer changes if != 0 */ | 1412 EXTERN int netbeansFireChanges INIT(= 1); // send buffer changes if != 0 |
1412 EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */ | 1413 EXTERN int netbeansForcedQuit INIT(= 0);// don't write modified files |
1413 EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */ | 1414 EXTERN int netbeansReadFile INIT(= 1); // OK to read from disk if != 0 |
1414 EXTERN int netbeansSuppressNoLines INIT(= 0); /* skip "No lines in buffer" */ | 1415 EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer" |
1415 #endif | 1416 #endif |
1416 | 1417 |
1417 /* | 1418 /* |
1418 * The error messages that can be shared are included here. | 1419 * The error messages that can be shared are included here. |
1419 * Excluded are errors that are only used once and debugging messages. | 1420 * Excluded are errors that are only used once and debugging messages. |
1633 | 1634 |
1634 /* | 1635 /* |
1635 * Comms. with the session manager (XSMP) | 1636 * Comms. with the session manager (XSMP) |
1636 */ | 1637 */ |
1637 #ifdef USE_XSMP | 1638 #ifdef USE_XSMP |
1638 EXTERN int xsmp_icefd INIT(= -1); /* The actual connection */ | 1639 EXTERN int xsmp_icefd INIT(= -1); // The actual connection |
1639 #endif | 1640 #endif |
1640 | 1641 |
1641 /* For undo we need to know the lowest time possible. */ | 1642 // For undo we need to know the lowest time possible. |
1642 EXTERN time_T starttime; | 1643 EXTERN time_T starttime; |
1643 | 1644 |
1644 #ifdef STARTUPTIME | 1645 #ifdef STARTUPTIME |
1645 EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */ | 1646 EXTERN FILE *time_fd INIT(= NULL); // where to write startup timing |
1646 #endif | 1647 #endif |
1647 | 1648 |
1648 /* | 1649 /* |
1649 * Some compilers warn for not using a return value, but in some situations we | 1650 * Some compilers warn for not using a return value, but in some situations we |
1650 * can't do anything useful with the value. Assign to this variable to avoid | 1651 * can't do anything useful with the value. Assign to this variable to avoid |
1652 */ | 1653 */ |
1653 EXTERN int vim_ignored; | 1654 EXTERN int vim_ignored; |
1654 EXTERN char *vim_ignoredp; | 1655 EXTERN char *vim_ignoredp; |
1655 | 1656 |
1656 #ifdef FEAT_EVAL | 1657 #ifdef FEAT_EVAL |
1657 /* set by alloc_fail(): ID */ | 1658 // set by alloc_fail(): ID |
1658 EXTERN alloc_id_T alloc_fail_id INIT(= aid_none); | 1659 EXTERN alloc_id_T alloc_fail_id INIT(= aid_none); |
1659 /* set by alloc_fail(), when zero alloc() returns NULL */ | 1660 // set by alloc_fail(), when zero alloc() returns NULL |
1660 EXTERN int alloc_fail_countdown INIT(= -1); | 1661 EXTERN int alloc_fail_countdown INIT(= -1); |
1661 /* set by alloc_fail(), number of times alloc() returns NULL */ | 1662 // set by alloc_fail(), number of times alloc() returns NULL |
1662 EXTERN int alloc_fail_repeat INIT(= 0); | 1663 EXTERN int alloc_fail_repeat INIT(= 0); |
1663 | 1664 |
1664 // flags set by test_override() | 1665 // flags set by test_override() |
1665 EXTERN int disable_char_avail_for_testing INIT(= FALSE); | 1666 EXTERN int disable_char_avail_for_testing INIT(= FALSE); |
1666 EXTERN int disable_redraw_for_testing INIT(= FALSE); | 1667 EXTERN int disable_redraw_for_testing INIT(= FALSE); |
1671 EXTERN int in_free_unref_items INIT(= FALSE); | 1672 EXTERN int in_free_unref_items INIT(= FALSE); |
1672 #endif | 1673 #endif |
1673 | 1674 |
1674 #ifdef FEAT_TIMERS | 1675 #ifdef FEAT_TIMERS |
1675 EXTERN int did_add_timer INIT(= FALSE); | 1676 EXTERN int did_add_timer INIT(= FALSE); |
1676 EXTERN int timer_busy INIT(= 0); /* when timer is inside vgetc() then > 0 */ | 1677 EXTERN int timer_busy INIT(= 0); // when timer is inside vgetc() then > 0 |
1677 #endif | 1678 #endif |
1678 | 1679 |
1679 #ifdef FEAT_BEVAL_TERM | 1680 #ifdef FEAT_BEVAL_TERM |
1680 EXTERN int bevalexpr_due_set INIT(= FALSE); | 1681 EXTERN int bevalexpr_due_set INIT(= FALSE); |
1681 EXTERN proftime_T bevalexpr_due; | 1682 EXTERN proftime_T bevalexpr_due; |
1682 #endif | 1683 #endif |
1683 | 1684 |
1684 #ifdef FEAT_EVAL | 1685 #ifdef FEAT_EVAL |
1685 EXTERN time_T time_for_testing INIT(= 0); | 1686 EXTERN time_T time_for_testing INIT(= 0); |
1686 | 1687 |
1687 /* Abort conversion to string after a recursion error. */ | 1688 // Abort conversion to string after a recursion error. |
1688 EXTERN int did_echo_string_emsg INIT(= FALSE); | 1689 EXTERN int did_echo_string_emsg INIT(= FALSE); |
1689 | 1690 |
1690 /* Used for checking if local variables or arguments used in a lambda. */ | 1691 // Used for checking if local variables or arguments used in a lambda. |
1691 EXTERN int *eval_lavars_used INIT(= NULL); | 1692 EXTERN int *eval_lavars_used INIT(= NULL); |
1692 #endif | 1693 #endif |
1693 | 1694 |
1694 #ifdef MSWIN | 1695 #ifdef MSWIN |
1695 # ifdef PROTO | 1696 # ifdef PROTO |