globals.h
Go to the documentation of this file.
1 #ifndef NVIM_GLOBALS_H
2 #define NVIM_GLOBALS_H
3 
4 #include <inttypes.h>
5 #include <stdbool.h>
6 
7 #include "nvim/event/loop.h"
8 #include "nvim/ex_eval.h"
9 #include "nvim/iconv.h"
10 #include "nvim/macros.h"
11 #include "nvim/mbyte.h"
12 #include "nvim/menu.h"
13 #include "nvim/os/os_defs.h"
14 #include "nvim/syntax_defs.h"
15 #include "nvim/types.h"
16 
17 #define IOSIZE (1024+1) // file I/O and sprintf buffer size
18 
19 #define MSG_BUF_LEN 480 // length of buffer for small messages
20 #define MSG_BUF_CLEN (MSG_BUF_LEN / 6) // cell length (worst case: utf-8
21  // takes 6 bytes for one cell)
22 
23 #ifdef WIN32
24 # define _PATHSEPSTR "\\"
25 #else
26 # define _PATHSEPSTR "/"
27 #endif
28 
29 #ifndef FILETYPE_FILE
30 # define FILETYPE_FILE "filetype.vim"
31 #endif
32 
33 #ifndef FTPLUGIN_FILE
34 # define FTPLUGIN_FILE "ftplugin.vim"
35 #endif
36 
37 #ifndef INDENT_FILE
38 # define INDENT_FILE "indent.vim"
39 #endif
40 
41 #ifndef FTOFF_FILE
42 # define FTOFF_FILE "ftoff.vim"
43 #endif
44 
45 #ifndef FTPLUGOF_FILE
46 # define FTPLUGOF_FILE "ftplugof.vim"
47 #endif
48 
49 #ifndef INDOFF_FILE
50 # define INDOFF_FILE "indoff.vim"
51 #endif
52 
53 #define DFLT_ERRORFILE "errors.err"
54 
55 #ifndef SYS_VIMRC_FILE
56 # define SYS_VIMRC_FILE "$VIM" _PATHSEPSTR "sysinit.vim"
57 #endif
58 
59 #ifndef DFLT_HELPFILE
60 # define DFLT_HELPFILE "$VIMRUNTIME" _PATHSEPSTR "doc" _PATHSEPSTR "help.txt"
61 #endif
62 
63 #ifndef SYNTAX_FNAME
64 # define SYNTAX_FNAME "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "%s.vim"
65 #endif
66 
67 #ifndef EXRC_FILE
68 # define EXRC_FILE ".exrc"
69 #endif
70 
71 #ifndef VIMRC_FILE
72 # define VIMRC_FILE ".nvimrc"
73 #endif
74 
76  int64_t fsync;
77  int64_t redraw;
78 } g_stats INIT(= { 0, 0 });
79 
80 // Values for "starting".
81 #define NO_SCREEN 2 // no screen updating yet
82 #define NO_BUFFERS 1 // not all buffers loaded yet
83 // 0 not starting anymore
84 
85 // Number of Rows and Columns in the screen.
86 // Note: Use default_grid.Rows and default_grid.Columns to access items in
87 // default_grid.chars[]. They may have different values when the screen
88 // wasn't (re)allocated yet after setting Rows or Columns (e.g., when starting
89 // up).
90 #define DFLT_COLS 80 // default value for 'columns'
91 #define DFLT_ROWS 24 // default value for 'lines'
92 EXTERN int Rows INIT(= DFLT_ROWS); // nr of rows in the screen
93 EXTERN int Columns INIT(= DFLT_COLS); // nr of columns in the screen
94 
95 EXTERN NS ns_hl_active INIT(= 0); // current ns that defines highlights
96 EXTERN bool ns_hl_changed INIT(= false); // highlight need update
97 
98 
99 // We use 64-bit file functions here, if available. E.g. ftello() returns
100 // off_t instead of long, which helps if long is 32 bit and off_t is 64 bit.
101 // We assume that when fseeko() is available then ftello() is too.
102 // Note that Windows has different function names.
103 #if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
104 typedef __int64 off_T;
105 # ifdef __MINGW32__
106 # define vim_lseek lseek64
107 # define vim_fseek fseeko64
108 # define vim_ftell ftello64
109 # else
110 # define vim_lseek _lseeki64
111 # define vim_fseek _fseeki64
112 # define vim_ftell _ftelli64
113 # endif
114 #else
115 typedef off_t off_T;
116 # ifdef HAVE_FSEEKO
117 # define vim_lseek lseek
118 # define vim_ftell ftello
119 # define vim_fseek fseeko
120 # else
121 # define vim_lseek lseek
122 # define vim_ftell ftell
123 # define vim_fseek(a, b, c) fseek(a, (long)b, c)
124 # endif
125 #endif
126 
127 // When vgetc() is called, it sets mod_mask to the set of modifiers that are
128 // held down based on the MOD_MASK_* symbols that are read first.
129 EXTERN int mod_mask INIT(= 0x0); // current key modifiers
130 
131 
132 // Cmdline_row is the row where the command line starts, just below the
133 // last window.
134 // When the cmdline gets longer than the available space the screen gets
135 // scrolled up. After a CTRL-D (show matches), after hitting ':' after
136 // "hit return", and for the :global command, the command line is
137 // temporarily moved. The old position is restored with the next call to
138 // update_screen().
140 
141 EXTERN bool redraw_cmdline INIT(= false); // cmdline must be redrawn
142 EXTERN bool clear_cmdline INIT(= false); // cmdline must be cleared
143 EXTERN bool mode_displayed INIT(= false); // mode is being displayed
144 EXTERN int cmdline_star INIT(= false); // cmdline is encrypted
145 EXTERN bool redrawing_cmdline INIT(= false); // cmdline is being redrawn
146 EXTERN bool cmdline_was_last_drawn INIT(= false); // cmdline was last drawn
147 
148 EXTERN bool exec_from_reg INIT(= false); // executing register
149 
150 // When '$' is included in 'cpoptions' option set:
151 // When a change command is given that deletes only part of a line, a dollar
152 // is put at the end of the changed text. dollar_vcol is set to the virtual
153 // column of this '$'. -1 is used to indicate no $ is being displayed.
154 EXTERN colnr_T dollar_vcol INIT(= -1);
155 
156 // Variables for Insert mode completion.
157 
158 // Length in bytes of the text being completed (this is deleted to be replaced
159 // by the match.)
160 EXTERN int compl_length INIT(= 0);
161 
162 // Set when character typed while looking for matches and it means we should
163 // stop looking for matches.
164 EXTERN int compl_interrupted INIT(= false);
165 
166 // Set when doing something for completion that may call edit() recursively,
167 // which is not allowed. Also used to disable folding during completion
168 EXTERN bool compl_busy INIT(= false);
169 
170 // List of flags for method of completion.
171 EXTERN int compl_cont_status INIT(= 0);
172 #define CONT_ADDING 1 // "normal" or "adding" expansion
173 #define CONT_INTRPT (2 + 4) // a ^X interrupted the current expansion
174  // it's set only iff N_ADDS is set
175 #define CONT_N_ADDS 4 // next ^X<> will add-new or expand-current
176 #define CONT_S_IPOS 8 // next ^X<> will set initial_pos?
177  // if so, word-wise-expansion will set SOL
178 #define CONT_SOL 16 // pattern includes start of line, just for
179  // word-wise expansion, not set for ^X^L
180 #define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local
181  // expansion, (eg use complete=.)
182 
183 EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
184 EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
185 EXTERN char_u *edit_submode_extra INIT(= NULL); // appended to edit_submode
186 EXTERN hlf_T edit_submode_highl; // highl. method for extra info
187 
188 // state for putting characters in the message area
189 EXTERN int cmdmsg_rl INIT(= false); // cmdline is drawn right to left
192 EXTERN int msg_scrolled; // Number of screen lines that windows have
193  // scrolled because of printing messages.
194 // when true don't set need_wait_return in msg_puts_attr()
195 // when msg_scrolled is non-zero
196 EXTERN bool msg_scrolled_ign INIT(= false);
197 // Whether the screen is damaged due to scrolling. Sometimes msg_scrolled
198 // is reset before the screen is redrawn, so we need to keep track of this.
199 EXTERN bool msg_did_scroll INIT(= false);
200 
201 
202 EXTERN char_u *keep_msg INIT(= NULL); // msg to be shown after redraw
203 EXTERN int keep_msg_attr INIT(= 0); // highlight attr for keep_msg
204 EXTERN bool keep_msg_more INIT(= false); // keep_msg was set by msgmore()
205 EXTERN bool need_fileinfo INIT(= false); // do fileinfo() after redraw
206 EXTERN int msg_scroll INIT(= false); // msg_start() will scroll
207 EXTERN bool msg_didout INIT(= false); // msg_outstr() was used in line
208 EXTERN bool msg_didany INIT(= false); // msg_outstr() was used at all
209 EXTERN bool msg_nowait INIT(= false); // don't wait for this msg
210 EXTERN int emsg_off INIT(= 0); // don't display errors for now,
211  // unless 'debug' is set.
212 EXTERN bool info_message INIT(= false); // printing informative message
213 EXTERN bool msg_hist_off INIT(= false); // don't add messages to history
214 EXTERN bool need_clr_eos INIT(= false); // need to clear text before
215  // displaying a message.
216 EXTERN int emsg_skip INIT(= 0); // don't display errors for
217  // expression that is skipped
218 EXTERN bool emsg_severe INIT(= false); // use message of next of several
219  // emsg() calls for throw
220 EXTERN bool did_endif INIT(= false); // just had ":endif"
221 EXTERN dict_T vimvardict; // Dictionary with v: variables
222 EXTERN dict_T globvardict; // Dictionary with g: variables
224 #define globvarht globvardict.dv_hashtab
225 EXTERN int did_emsg; // set by emsg() when the message
226  // is displayed or thrown
227 EXTERN bool called_vim_beep; // set if vim_beep() is called
228 EXTERN bool did_emsg_syntax; // did_emsg set because of a
229  // syntax error
230 EXTERN int called_emsg; // always set by emsg()
231 EXTERN int ex_exitval INIT(= 0); // exit value for ex mode
232 EXTERN bool emsg_on_display INIT(= false); // there is an error message
233 EXTERN bool rc_did_emsg INIT(= false); // vim_regcomp() called emsg()
234 
235 EXTERN int no_wait_return INIT(= 0); // don't wait for return for now
236 EXTERN bool need_wait_return INIT(= false); // need to wait for return later
237 EXTERN bool did_wait_return INIT(= false); // wait_return() was used and
238  // nothing written since then
239 EXTERN bool need_maketitle INIT(= true); // call maketitle() soon
240 
241 EXTERN int quit_more INIT(= false); // 'q' hit at "--more--" msg
242 EXTERN int vgetc_busy INIT(= 0); // when inside vgetc() then > 0
243 
244 EXTERN bool didset_vim INIT(= false); // did set $VIM ourselves
245 EXTERN bool didset_vimruntime INIT(= false); // idem for $VIMRUNTIME
246 
249 EXTERN int lines_left INIT(= -1); // lines left for listing
250 EXTERN int msg_no_more INIT(= false); // don't use more prompt, truncate
251  // messages
252 
253 EXTERN char_u *sourcing_name INIT(= NULL); // name of error message source
254 EXTERN linenr_T sourcing_lnum INIT(= 0); // line number of the source file
255 
256 EXTERN int ex_nesting_level INIT(= 0); // nesting level
257 EXTERN int debug_break_level INIT(= -1); // break below this level
258 EXTERN bool debug_did_msg INIT(= false); // did "debug mode" message
259 EXTERN int debug_tick INIT(= 0); // breakpoint change count
260 EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level
261 
262 // Values for "do_profiling".
263 #define PROF_NONE 0
264 #define PROF_YES 1
265 #define PROF_PAUSED 2
266 EXTERN int do_profiling INIT(= PROF_NONE);
267 
272 
275 EXTERN int need_rethrow INIT(= false);
276 
279 EXTERN int check_cstack INIT(= false);
280 
283 EXTERN int trylevel INIT(= 0);
284 
291 EXTERN int force_abort INIT(= false);
292 
301 EXTERN struct msglist **msg_list INIT(= NULL);
302 
307 EXTERN bool suppress_errthrow INIT(= false);
308 
313 EXTERN except_T *caught_stack INIT(= NULL);
314 
315 
324 EXTERN bool may_garbage_collect INIT(= false);
325 EXTERN int want_garbage_collect INIT(= false);
326 EXTERN int garbage_collect_at_exit INIT(= false);
327 
328 // Special values for current_SID.
329 #define SID_MODELINE -1 // when using a modeline
330 #define SID_CMDARG -2 // for "--cmd" argument
331 #define SID_CARG -3 // for "-c" argument
332 #define SID_ENV -4 // for sourcing environment variable
333 #define SID_ERROR -5 // option was reset because of an error
334 #define SID_NONE -6 // don't set scriptID
335 #define SID_WINLAYOUT -7 // changing window size
336 #define SID_LUA -8 // for Lua scripts/chunks
337 #define SID_API_CLIENT -9 // for API clients
338 #define SID_STR -10 // for sourcing a string with no script item
339 
340 // Script CTX being sourced or was sourced to define the current function.
341 EXTERN sctx_T current_sctx INIT(= { 0 COMMA 0 COMMA 0 });
342 // ID of the current channel making a client API call
343 EXTERN uint64_t current_channel_id INIT(= 0);
344 
345 EXTERN bool did_source_packages INIT(= false);
346 
347 // Scope information for the code that indirectly triggered the current
348 // provider function call
354  void *funccalp;
356 EXTERN int provider_call_nesting INIT(= 0);
357 
358 
359 EXTERN int t_colors INIT(= 256); // int value of T_CCO
360 
361 // When highlight_match is true, highlight a match, starting at the cursor
362 // position. Search_match_lines is the number of lines after the match (0 for
363 // a match within one line), search_match_endcol the column number of the
364 // character just after the match in the last line.
365 EXTERN bool highlight_match INIT(= false); // show search match pos
366 EXTERN linenr_T search_match_lines; // lines of matched string
367 EXTERN colnr_T search_match_endcol; // col nr of match end
368 EXTERN linenr_T search_first_line INIT(= 0); // for :{FIRST},{last}s/pat
369 EXTERN linenr_T search_last_line INIT(= MAXLNUM); // for :{first},{LAST}s/pat
370 
371 EXTERN bool no_smartcase INIT(= false); // don't use 'smartcase' once
372 
373 EXTERN int need_check_timestamps INIT(= false); // need to check file
374  // timestamps asap
375 EXTERN int did_check_timestamps INIT(= false); // did check timestamps
376  // recently
377 EXTERN int no_check_timestamps INIT(= 0); // Don't check timestamps
378 
379 EXTERN int autocmd_busy INIT(= false); // Is apply_autocmds() busy?
380 EXTERN int autocmd_no_enter INIT(= false); // *Enter autocmds disabled
381 EXTERN int autocmd_no_leave INIT(= false); // *Leave autocmds disabled
382 EXTERN int modified_was_set; // did ":set modified"
383 EXTERN int did_filetype INIT(= false); // FileType event found
384 // value for did_filetype when starting to execute autocommands
385 EXTERN int keep_filetype INIT(= false);
386 
387 // When deleting the current buffer, another one must be loaded.
388 // If we know which one is preferred, au_new_curbuf is set to it.
389 EXTERN bufref_T au_new_curbuf INIT(= { NULL, 0, 0 });
390 
391 // When deleting a buffer/window and autocmd_busy is true, do not free the
392 // buffer/window. but link it in the list starting with
393 // au_pending_free_buf/ap_pending_free_win, using b_next/w_next.
394 // Free the buffer/window when autocmd_busy is being set to false.
395 EXTERN buf_T *au_pending_free_buf INIT(= NULL);
396 EXTERN win_T *au_pending_free_win INIT(= NULL);
397 
398 // Mouse coordinates, set by handle_mouse_event()
402 EXTERN bool mouse_past_bottom INIT(= false); // mouse below last line
403 EXTERN bool mouse_past_eol INIT(= false); // mouse right of line
404 EXTERN int mouse_dragging INIT(= 0); // extending Visual area with
405  // mouse dragging
406 
407 // The root of the menu hierarchy.
408 EXTERN vimmenu_T *root_menu INIT(= NULL);
409 // While defining the system menu, sys_menu is true. This avoids
410 // overruling of menus that the user already defined.
411 EXTERN int sys_menu INIT(= false);
412 
413 // While redrawing the screen this flag is set. It means the screen size
414 // ('lines' and 'rows') must not be changed.
415 EXTERN int updating_screen INIT(= 0);
416 
417 // All windows are linked in a list. firstwin points to the first entry,
418 // lastwin to the last entry (can be the same as firstwin) and curwin to the
419 // currently active window.
420 EXTERN win_T *firstwin; // first window
421 EXTERN win_T *lastwin; // last window
422 EXTERN win_T *prevwin INIT(= NULL); // previous window
423 #define ONE_WINDOW (firstwin == lastwin)
424 #define FOR_ALL_FRAMES(frp, first_frame) \
425  for (frp = first_frame; frp != NULL; frp = frp->fr_next) // NOLINT
426 
427 // When using this macro "break" only breaks out of the inner loop. Use "goto"
428 // to break out of the tabpage loop.
429 #define FOR_ALL_TAB_WINDOWS(tp, wp) \
430  FOR_ALL_TABS(tp) \
431  FOR_ALL_WINDOWS_IN_TAB(wp, tp)
432 
433 // -V:FOR_ALL_WINDOWS_IN_TAB:501
434 #define FOR_ALL_WINDOWS_IN_TAB(wp, tp) \
435  for (win_T *wp = ((tp) == curtab) \
436  ? firstwin : (tp)->tp_firstwin; wp != NULL; wp = wp->w_next)
437 
438 EXTERN win_T *curwin; // currently active window
439 
440 EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf()
441 EXTERN int aucmd_win_used INIT(= false); // aucmd_win is being used
442 
443 // The window layout is kept in a tree of frames. topframe points to the top
444 // of the tree.
445 EXTERN frame_T *topframe; // top of the window frame tree
446 
447 // Tab pages are alternative topframes. "first_tabpage" points to the first
448 // one in the list, "curtab" is the current one.
452 EXTERN bool redraw_tabline INIT(= false); // need to redraw tabline
453 
454 // Iterates over all tabs in the tab list
455 #define FOR_ALL_TABS(tp) for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
456 
457 // All buffers are linked in a list. 'firstbuf' points to the first entry,
458 // 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
459 EXTERN buf_T *firstbuf INIT(= NULL); // first buffer
460 EXTERN buf_T *lastbuf INIT(= NULL); // last buffer
461 EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
462 
463 // Iterates over all buffers in the buffer list.
464 #define FOR_ALL_BUFFERS(buf) \
465  for (buf_T *buf = firstbuf; buf != NULL; buf = buf->b_next)
466 #define FOR_ALL_BUFFERS_BACKWARDS(buf) \
467  for (buf_T *buf = lastbuf; buf != NULL; buf = buf->b_prev)
468 
469 // Iterate through all the signs placed in a buffer
470 #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
471  for (sign = buf->b_signlist; sign != NULL; sign = sign->se_next) // NOLINT
472 
473 
474 // List of files being edited (global argument list). curwin->w_alist points
475 // to this when the window is using the global argument list.
476 EXTERN alist_T global_alist; // global argument list
477 EXTERN int max_alist_id INIT(= 0);
478 EXTERN bool arg_had_last INIT(= false); // accessed last file in
479  // global_alist
480 
481 EXTERN int ru_col; // column for ruler
482 EXTERN int ru_wid; // 'rulerfmt' width of ruler when non-zero
483 EXTERN int sc_col; // column for shown command
484 
485 // When starting or exiting some things are done differently (e.g. screen
486 // updating).
487 
488 // First NO_SCREEN, then NO_BUFFERS, then 0 when startup finished.
489 EXTERN int starting INIT(= NO_SCREEN);
490 // true when planning to exit. Might keep running if there is a changed buffer.
491 EXTERN bool exiting INIT(= false);
492 // internal value of v:dying
493 EXTERN int v_dying INIT(= 0);
494 // is stdin a terminal?
495 EXTERN int stdin_isatty INIT(= true);
496 // is stdout a terminal?
497 EXTERN int stdout_isatty INIT(= true);
498 // true when doing full-screen output, otherwise only writing some messages.
499 // volatile because it is used in a signal handler.
500 EXTERN volatile int full_screen INIT(= false);
501 
504 EXTERN int secure INIT(= 0);
505 
508 EXTERN int textlock INIT(= 0);
509 
512 EXTERN int allbuf_lock INIT(= 0);
513 
516 EXTERN int sandbox INIT(= 0);
517 
519 EXTERN int silent_mode INIT(= false);
520 
524 EXTERN int VIsual_active INIT(= false);
526 EXTERN int VIsual_select INIT(= false);
528 EXTERN int restart_VIsual_select INIT(= 0);
532 EXTERN int VIsual_mode INIT(= 'v');
534 EXTERN int redo_VIsual_busy INIT(= false);
535 
539 
540 // This flag is used to make auto-indent work right on lines where only a
541 // <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
542 // reset when any other editing is done on the line. If an <ESC> or <RETURN>
543 // is received, and did_ai is true, the line is truncated.
544 EXTERN bool did_ai INIT(= false);
545 
546 // Column of first char after autoindent. 0 when no autoindent done. Used
547 // when 'backspace' is 0, to avoid backspacing over autoindent.
548 EXTERN colnr_T ai_col INIT(= 0);
549 
550 // This is a character which will end a start-middle-end comment when typed as
551 // the first character on a new line. It is taken from the last character of
552 // the "end" comment leader when the COM_AUTO_END flag is given for that
553 // comment end in 'comments'. It is only valid when did_ai is true.
554 EXTERN int end_comment_pending INIT(= NUL);
555 
556 // This flag is set after a ":syncbind" to let the check_scrollbind() function
557 // know that it should not attempt to perform scrollbinding due to the scroll
558 // that was a result of the ":syncbind." (Otherwise, check_scrollbind() will
559 // undo some of the work done by ":syncbind.") -ralston
560 EXTERN bool did_syncbind INIT(= false);
561 
562 // This flag is set when a smart indent has been performed. When the next typed
563 // character is a '{' the inserted tab will be deleted again.
564 EXTERN bool did_si INIT(= false);
565 
566 // This flag is set after an auto indent. If the next typed character is a '}'
567 // one indent will be removed.
568 EXTERN bool can_si INIT(= false);
569 
570 // This flag is set after an "O" command. If the next typed character is a '{'
571 // one indent will be removed.
572 EXTERN bool can_si_back INIT(= false);
573 
574 // w_cursor before formatting text.
575 EXTERN pos_T saved_cursor INIT(= { 0, 0, 0 });
576 
577 // Stuff for insert mode.
578 EXTERN pos_T Insstart; // This is where the latest
579  // insert/append mode started.
580 
581 // This is where the latest insert/append mode started. In contrast to
582 // Insstart, this won't be reset by certain keys and is needed for
583 // op_insert(), to detect correctly where inserting by the user started.
585 
586 // Stuff for VREPLACE mode.
587 EXTERN int orig_line_count INIT(= 0); // Line count when "gR" started
588 EXTERN int vr_lines_changed INIT(= 0); // #Lines changed by "gR" so far
589 
590 // increase around internal delete/replace
591 EXTERN int inhibit_delete_count INIT(= 0);
592 
593 // These flags are set based upon 'fileencoding'.
594 // The characters are internally stored as UTF-8
595 // to avoid trouble with NUL bytes.
596 #define DBCS_JPN 932 // japan
597 #define DBCS_JPNU 9932 // euc-jp
598 #define DBCS_KOR 949 // korea
599 #define DBCS_KORU 9949 // euc-kr
600 #define DBCS_CHS 936 // chinese
601 #define DBCS_CHSU 9936 // euc-cn
602 #define DBCS_CHT 950 // taiwan
603 #define DBCS_CHTU 9950 // euc-tw
604 #define DBCS_2BYTE 1 // 2byte-
605 #define DBCS_DEBUG -1
606 
608 EXTERN char_u *fenc_default INIT(= NULL);
609 
617 EXTERN int State INIT(= NORMAL); // This is the current state of the
618  // command interpreter.
619 EXTERN bool debug_mode INIT(= false);
620 EXTERN bool finish_op INIT(= false); // true while an operator is pending
621 EXTERN long opcount INIT(= 0); // count for pending operator
622 EXTERN int motion_force INIT(=0); // motion force for pending operator
623 
624 // Ex Mode (Q) state
625 EXTERN bool exmode_active INIT(= false); // true if Ex mode is active
626 EXTERN bool ex_no_reprint INIT(=false); // No need to print after z or p.
627 
628 EXTERN int reg_recording INIT(= 0); // register for recording or zero
629 EXTERN int reg_executing INIT(= 0); // register being executed or zero
630 
631 EXTERN int no_mapping INIT(= false); // currently no mapping allowed
632 EXTERN int no_zero_mapping INIT(= 0); // mapping zero not allowed
633 EXTERN int no_u_sync INIT(= 0); // Don't call u_sync()
634 EXTERN int u_sync_once INIT(= 0); // Call u_sync() once when evaluating
635  // an expression.
636 
637 EXTERN bool force_restart_edit INIT(= false); // force restart_edit after
638  // ex_normal returns
639 EXTERN int restart_edit INIT(= 0); // call edit when next cmd finished
640 EXTERN int arrow_used; // Normally false, set to true after
641  // hitting cursor key in insert mode.
642  // Used by vgetorpeek() to decide when
643  // to call u_sync()
644 EXTERN bool ins_at_eol INIT(= false); // put cursor after eol when
645  // restarting edit after CTRL-O
646 
647 EXTERN bool no_abbr INIT(= true); // true when no abbreviations loaded
648 
649 EXTERN int mapped_ctrl_c INIT(= 0); // Modes where CTRL-C is mapped.
650 
651 EXTERN cmdmod_T cmdmod; // Ex command modifiers
652 
653 EXTERN int msg_silent INIT(= 0); // don't print messages
654 EXTERN int emsg_silent INIT(= 0); // don't print error messages
655 EXTERN bool emsg_noredir INIT(= false); // don't redirect error messages
656 EXTERN bool cmd_silent INIT(= false); // don't echo the command line
657 
658 // Values for swap_exists_action: what to do when swap file already exists
659 #define SEA_NONE 0 // don't use dialog
660 #define SEA_DIALOG 1 // use dialog when possible
661 #define SEA_QUIT 2 // quit editing the file
662 #define SEA_RECOVER 3 // recover the file
663 
664 EXTERN int swap_exists_action INIT(= SEA_NONE);
665 // For dialog when swap file already
666 // exists.
667 EXTERN bool swap_exists_did_quit INIT(= false);
668 // Selected "quit" at the dialog.
669 
673 EXTERN char os_buf[
674 #if MAXPATHL > IOSIZE
675  MAXPATHL
676 #else
677  IOSIZE
678 #endif
679 ];
680 
681 // When non-zero, postpone redrawing.
682 EXTERN int RedrawingDisabled INIT(= 0);
683 
684 EXTERN int readonlymode INIT(= false); // Set to true for "view"
685 EXTERN int recoverymode INIT(= false); // Set to true for "-r" option
686 
687 // typeahead buffer
688 EXTERN typebuf_T typebuf INIT(= { NULL, NULL, 0, 0, 0, 0, 0, 0, 0 });
689 
690 EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal()
691 EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal()
692 EXTERN int ignore_script INIT(= false); // ignore script input
693 EXTERN int stop_insert_mode; // for ":stopinsert" and 'insertmode'
694 EXTERN bool KeyTyped; // true if user typed current char
695 EXTERN int KeyStuffed; // true if current char from stuffbuf
696 EXTERN int maptick INIT(= 0); // tick for each non-mapped char
697 
698 EXTERN int must_redraw INIT(= 0); // type of redraw necessary
699 EXTERN bool skip_redraw INIT(= false); // skip redraw once
700 EXTERN bool do_redraw INIT(= false); // extra redraw once
701 EXTERN bool must_redraw_pum INIT(= false); // redraw pum. NB: must_redraw
702  // should also be set.
703 
704 EXTERN bool need_highlight_changed INIT(= true);
705 
706 EXTERN FILE *scriptout INIT(= NULL);
707 
708 // volatile because it is used in a signal handler.
709 EXTERN volatile int got_int INIT(= false); // set to true when interrupt
710  // signal occurred
711 EXTERN bool bangredo INIT(= false); // set to true with ! command
712 EXTERN int searchcmdlen; // length of previous search cmd
713 EXTERN int reg_do_extmatch INIT(= 0); // Used when compiling regexp:
714  // REX_SET to allow \z\(...\),
715  // REX_USE to allow \z\1 et al.
716 // Used by vim_regexec(): strings for \z\1...\z\9
717 EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL);
718 // Set by vim_regexec() to store \z\(...\) matches
719 EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL);
720 
721 EXTERN bool did_outofmem_msg INIT(= false);
722 // set after out of memory msg
723 EXTERN bool did_swapwrite_msg INIT(= false);
724 // set after swap write error msg
725 EXTERN int global_busy INIT(= 0); // set when :global is executing
726 EXTERN bool listcmd_busy INIT(= false); // set when :argdo, :windo or
727  // :bufdo is executing
728 EXTERN bool need_start_insertmode INIT(= false);
729 // start insert mode soon
730 EXTERN char *last_mode INIT(= NULL);
731 EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":)
732 EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "."
733 EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline
734 EXTERN char_u *autocmd_fname INIT(= NULL); // fname for <afile> on cmdline
735 EXTERN int autocmd_bufnr INIT(= 0); // fnum for <abuf> on cmdline
736 EXTERN char_u *autocmd_match INIT(= NULL); // name for <amatch> on cmdline
737 EXTERN bool did_cursorhold INIT(= false); // set when CursorHold t'gerd
738 
739 EXTERN int postponed_split INIT(= 0); // for CTRL-W CTRL-] command
740 EXTERN int postponed_split_flags INIT(= 0); // args for win_split()
741 EXTERN int postponed_split_tab INIT(= 0); // cmdmod.tab
742 EXTERN int g_do_tagpreview INIT(= 0); // for tag preview commands:
743  // height of preview window
744 EXTERN bool g_tag_at_cursor INIT(= false); // whether the tag command comes
745  // from the command line (0) or was
746  // invoked as a normal command (1)
747 
748 EXTERN int replace_offset INIT(= 0); // offset for replace_push()
749 
750 EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|");
751 // need backslash in cmd line
752 
753 EXTERN int keep_help_flag INIT(= false); // doing :ta from help file
754 
755 // When a string option is NULL (which only happens in out-of-memory
756 // situations), it is set to empty_option, to avoid having to check for NULL
757 // everywhere.
758 EXTERN char_u *empty_option INIT(= (char_u *)"");
759 
760 EXTERN bool redir_off INIT(= false); // no redirection for a moment
761 EXTERN FILE *redir_fd INIT(= NULL); // message redirection file
762 EXTERN int redir_reg INIT(= 0); // message redirection register
763 EXTERN int redir_vname INIT(= 0); // message redirection variable
764 EXTERN garray_T *capture_ga INIT(= NULL); // captured output for execute()
765 
766 EXTERN char_u langmap_mapchar[256]; // mapping for language keys
767 
768 EXTERN int save_p_ls INIT(= -1); // Save 'laststatus' setting
769 EXTERN int save_p_wmh INIT(= -1); // Save 'winminheight' setting
770 EXTERN int wild_menu_showing INIT(= 0);
771 enum {
772  WM_SHOWN = 1,
774  WM_LIST = 3,
775 };
776 
777 
778 // Some file names are stored in pathdef.c, which is generated from the
779 // Makefile to make their value depend on the Makefile.
780 #ifdef HAVE_PATHDEF
781 extern char *default_vim_dir;
782 extern char *default_vimruntime_dir;
783 extern char *default_lib_dir;
784 extern char_u *compiled_user;
785 extern char_u *compiled_sys;
786 #endif
787 
788 // When a window has a local directory, the absolute path of the global
789 // current directory is stored here (in allocated memory). If the current
790 // directory is not a local directory, globaldir is NULL.
791 EXTERN char_u *globaldir INIT(= NULL);
792 
793 EXTERN char *last_chdir_reason INIT(= NULL);
794 
795 // Whether 'keymodel' contains "stopsel" and "startsel".
796 EXTERN bool km_stopsel INIT(= false);
797 EXTERN bool km_startsel INIT(= false);
798 
799 EXTERN int cedit_key INIT(= -1);
800 EXTERN int cmdwin_type INIT(= 0);
801 EXTERN int cmdwin_result INIT(= 0);
802 EXTERN int cmdwin_level INIT(= 0);
803 
804 EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--"));
805 
806 // When ":global" is used to number of substitutions and changed lines is
807 // accumulated until it's finished.
808 // Also used for ":spellrepall".
809 EXTERN long sub_nsubs; // total number of substitutions
810 EXTERN linenr_T sub_nlines; // total number of lines changed
811 
812 // table to store parsed 'wildmode'
814 
815 // whether titlestring and iconstring contains statusline syntax
816 #define STL_IN_ICON 1
817 #define STL_IN_TITLE 2
818 EXTERN int stl_syntax INIT(= 0);
819 
820 // don't use 'hlsearch' temporarily
821 EXTERN bool no_hlsearch INIT(= false);
822 
823 // Page number used for %N in 'pageheader' and 'guitablabel'.
825 
826 
827 EXTERN bool typebuf_was_filled INIT(= false); // received text from client
828  // or from feedkeys()
829 
830 
831 #ifdef BACKSLASH_IN_FILENAME
832 EXTERN char psepc INIT(= '\\'); // normal path separator character
833 EXTERN char psepcN INIT(= '/'); // abnormal path separator character
834 EXTERN char pseps[2] INIT(= { '\\', 0 }); // normal path separator string
835 #endif
836 
837 // Set to kTrue when an operator is being executed with virtual editing
838 // kNone when no operator is being executed, kFalse otherwise.
839 EXTERN TriState virtual_op INIT(= kNone);
840 
841 // Display tick, incremented for each call to update_screen()
842 EXTERN disptick_T display_tick INIT(= 0);
843 
844 // Line in which spell checking wasn't highlighted because it touched the
845 // cursor position in Insert mode.
846 EXTERN linenr_T spell_redraw_lnum INIT(= 0);
847 
848 // uncrustify:off
849 
850 // The error messages that can be shared are included here.
851 // Excluded are errors that are only used once and debugging messages.
852 EXTERN char e_abort[] INIT(= N_("E470: Command aborted"));
853 EXTERN char e_afterinit[] INIT(= N_("E905: Cannot set this option after startup"));
854 EXTERN char e_api_spawn_failed[] INIT(= N_("E903: Could not spawn API job"));
855 EXTERN char e_argreq[] INIT(= N_("E471: Argument required"));
856 EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &"));
857 EXTERN char e_cmdwin[] INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
858 EXTERN char e_curdir[] INIT(= N_( "E12: Command not allowed from exrc/vimrc in current dir or tag search"));
859 EXTERN char e_endif[] INIT(= N_("E171: Missing :endif"));
860 EXTERN char e_endtry[] INIT(= N_("E600: Missing :endtry"));
861 EXTERN char e_endwhile[] INIT(= N_("E170: Missing :endwhile"));
862 EXTERN char e_endfor[] INIT(= N_("E170: Missing :endfor"));
863 EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while"));
864 EXTERN char e_for[] INIT(= N_("E588: :endfor without :for"));
865 EXTERN char e_exists[] INIT(= N_("E13: File exists (add ! to override)"));
866 EXTERN char e_failed[] INIT(= N_("E472: Command failed"));
867 EXTERN char e_internal[] INIT(= N_("E473: Internal error"));
868 EXTERN char e_intern2[] INIT(= N_("E685: Internal error: %s"));
869 EXTERN char e_interr[] INIT(= N_("Interrupted"));
870 EXTERN char e_invarg[] INIT(= N_("E474: Invalid argument"));
871 EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
872 EXTERN char e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
873 EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
874 EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate argument: %s"));
875 EXTERN char e_invexpr2[] INIT(= N_("E15: Invalid expression: %s"));
876 EXTERN char e_invrange[] INIT(= N_("E16: Invalid range"));
877 EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command"));
878 EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
879 EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible"));
880 EXTERN char e_invchan[] INIT(= N_("E900: Invalid channel id"));
881 EXTERN char e_invchanjob[] INIT(= N_("E900: Invalid channel id: not a job"));
882 EXTERN char e_jobtblfull[] INIT(= N_("E901: Job table is full"));
883 EXTERN char e_jobspawn[] INIT(= N_("E903: Process failed to start: %s: \"%s\""));
884 EXTERN char e_channotpty[] INIT(= N_("E904: channel is not a pty"));
885 EXTERN char e_stdiochan2[] INIT(= N_("E905: Couldn't open stdio channel: %s"));
886 EXTERN char e_invstream[] INIT(= N_("E906: invalid stream for channel"));
887 EXTERN char e_invstreamrpc[] INIT(= N_("E906: invalid stream for rpc channel, use 'rpc'"));
888 EXTERN char e_streamkey[] INIT(= N_("E5210: dict key '%s' already set for buffered stream in channel %" PRIu64));
889 EXTERN char e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
890 EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed: %s"));
891 EXTERN char e_mkdir[] INIT(= N_("E739: Cannot create directory %s: %s"));
892 EXTERN char e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
893 EXTERN char e_marknotset[] INIT(= N_("E20: Mark not set"));
894 EXTERN char e_modifiable[] INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
895 EXTERN char e_nesting[] INIT(= N_("E22: Scripts nested too deep"));
896 EXTERN char e_noalt[] INIT(= N_("E23: No alternate file"));
897 EXTERN char e_noabbr[] INIT(= N_("E24: No such abbreviation"));
898 EXTERN char e_nobang[] INIT(= N_("E477: No ! allowed"));
899 EXTERN char e_nogroup[] INIT(= N_("E28: No such highlight group name: %s"));
900 EXTERN char e_noinstext[] INIT(= N_("E29: No inserted text yet"));
901 EXTERN char e_nolastcmd[] INIT(= N_("E30: No previous command line"));
902 EXTERN char e_nomap[] INIT(= N_("E31: No such mapping"));
903 EXTERN char e_nomatch[] INIT(= N_("E479: No match"));
904 EXTERN char e_nomatch2[] INIT(= N_("E480: No match: %s"));
905 EXTERN char e_noname[] INIT(= N_("E32: No file name"));
906 EXTERN char e_nopresub[] INIT(= N_("E33: No previous substitute regular expression"));
907 EXTERN char e_noprev[] INIT(= N_("E34: No previous command"));
908 EXTERN char e_noprevre[] INIT(= N_("E35: No previous regular expression"));
909 EXTERN char e_norange[] INIT(= N_("E481: No range allowed"));
910 EXTERN char e_noroom[] INIT(= N_("E36: Not enough room"));
911 EXTERN char e_notmp[] INIT(= N_("E483: Can't get temp file name"));
912 EXTERN char e_notopen[] INIT(= N_("E484: Can't open file %s"));
913 EXTERN char e_notopen_2[] INIT(= N_("E484: Can't open file %s: %s"));
914 EXTERN char e_notread[] INIT(= N_("E485: Can't read file %s"));
915 EXTERN char e_null[] INIT(= N_("E38: Null argument"));
916 EXTERN char e_number_exp[] INIT(= N_("E39: Number expected"));
917 EXTERN char e_openerrf[] INIT(= N_("E40: Can't open errorfile %s"));
918 EXTERN char e_outofmem[] INIT(= N_("E41: Out of memory!"));
919 EXTERN char e_patnotf[] INIT(= N_("Pattern not found"));
920 EXTERN char e_patnotf2[] INIT(= N_("E486: Pattern not found: %s"));
921 EXTERN char e_positive[] INIT(= N_("E487: Argument must be positive"));
922 EXTERN char e_prev_dir[] INIT(= N_("E459: Cannot go back to previous directory"));
923 
924 EXTERN char e_quickfix[] INIT(= N_("E42: No Errors"));
925 EXTERN char e_loclist[] INIT(= N_("E776: No location list"));
926 EXTERN char e_re_damg[] INIT(= N_("E43: Damaged match string"));
927 EXTERN char e_re_corr[] INIT(= N_("E44: Corrupted regexp program"));
928 EXTERN char e_readonly[] INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
929 EXTERN char e_readonlyvar[] INIT(= N_("E46: Cannot change read-only variable \"%.*s\""));
930 EXTERN char e_stringreq[] INIT(= N_("E928: String required"));
931 EXTERN char e_dictreq[] INIT(= N_("E715: Dictionary required"));
932 EXTERN char e_blobidx[] INIT(= N_("E979: Blob index out of range: %" PRId64));
933 EXTERN char e_invalblob[] INIT(= N_("E978: Invalid operation for Blob"));
934 EXTERN char e_toomanyarg[] INIT(= N_("E118: Too many arguments for function: %s"));
935 EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
936 EXTERN char e_listreq[] INIT(= N_("E714: List required"));
937 EXTERN char e_listblobreq[] INIT(= N_("E897: List or Blob required"));
938 EXTERN char e_listdictarg[] INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
939 EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob"));
940 EXTERN char e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
941 EXTERN char e_sandbox[] INIT(= N_("E48: Not allowed in sandbox"));
942 EXTERN char e_secure[] INIT(= N_("E523: Not allowed here"));
943 EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported"));
944 EXTERN char e_scroll[] INIT(= N_("E49: Invalid scroll size"));
945 EXTERN char e_shellempty[] INIT(= N_("E91: 'shell' option is empty"));
946 EXTERN char e_signdata[] INIT(= N_("E255: Couldn't read in sign data!"));
947 EXTERN char e_swapclose[] INIT(= N_("E72: Close error on swap file"));
948 EXTERN char e_tagstack[] INIT(= N_("E73: tag stack empty"));
949 EXTERN char e_toocompl[] INIT(= N_("E74: Command too complex"));
950 EXTERN char e_longname[] INIT(= N_("E75: Name too long"));
951 EXTERN char e_toomsbra[] INIT(= N_("E76: Too many ["));
952 EXTERN char e_toomany[] INIT(= N_("E77: Too many file names"));
953 EXTERN char e_trailing[] INIT(= N_("E488: Trailing characters"));
954 EXTERN char e_trailing2[] INIT(= N_("E488: Trailing characters: %s"));
955 EXTERN char e_umark[] INIT(= N_("E78: Unknown mark"));
956 EXTERN char e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
957 EXTERN char e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
958 EXTERN char e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
959 EXTERN char e_write[] INIT(= N_("E80: Error while writing"));
960 EXTERN char e_zerocount[] INIT(= N_("E939: Positive count required"));
961 EXTERN char e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
962 EXTERN char e_missingparen[] INIT(= N_("E107: Missing parentheses: %s"));
963 EXTERN char e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
964 EXTERN char e_emptybuf[] INIT(= N_("E749: empty buffer"));
965 EXTERN char e_nobufnr[] INIT(= N_("E86: Buffer %" PRId64 " does not exist"));
966 
967 EXTERN char e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter"));
968 EXTERN char e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
969 EXTERN char e_notset[] INIT(= N_("E764: Option '%s' is not set"));
970 EXTERN char e_invalidreg[] INIT(= N_("E850: Invalid register name"));
971 EXTERN char e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
972 EXTERN char e_au_recursive[] INIT(= N_("E952: Autocommand caused recursive behavior"));
973 EXTERN char e_autocmd_close[] INIT(= N_("E813: Cannot close autocmd window"));
974 EXTERN char e_unsupportedoption[] INIT(= N_("E519: Option not supported"));
975 EXTERN char e_fnametoolong[] INIT(= N_("E856: Filename too long"));
976 EXTERN char e_float_as_string[] INIT(= N_("E806: using Float as a String"));
977 
978 EXTERN char e_autocmd_err[] INIT(= N_("E5500: autocmd has thrown an exception: %s"));
979 EXTERN char e_cmdmap_err[] INIT(= N_("E5520: <Cmd> mapping must end with <CR>"));
980 EXTERN char e_cmdmap_repeated[] INIT(= N_("E5521: <Cmd> mapping must end with <CR> before second <Cmd>"));
981 EXTERN char e_cmdmap_key[] INIT(= N_("E5522: <Cmd> mapping must not include %s key"));
982 
983 EXTERN char e_api_error[] INIT(= N_("E5555: API call: %s"));
984 
985 EXTERN char e_luv_api_disabled[] INIT(= N_("E5560: %s must not be called in a lua loop callback"));
986 
987 EXTERN char e_floatonly[] INIT(= N_("E5601: Cannot close window, only floating window would remain"));
988 EXTERN char e_floatexchange[] INIT(= N_("E5602: Cannot exchange or rotate float"));
989 
990 EXTERN char e_non_empty_string_required[] INIT(= N_("E1142: Non-empty string required"));
991 
992 EXTERN char e_cannot_define_autocommands_for_all_events[] INIT(= N_("E1155: Cannot define autocommands for ALL events"));
993 
994 EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
995 EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
996 
997 EXTERN char line_msg[] INIT(= N_(" line "));
998 
999 // For undo we need to know the lowest time possible.
1001 
1002 EXTERN FILE *time_fd INIT(= NULL); // where to write startup timing
1003 
1004 // Some compilers warn for not using a return value, but in some situations we
1005 // can't do anything useful with the value. Assign to this variable to avoid
1006 // the warning.
1008 
1009 // Start a msgpack-rpc channel over stdin/stdout.
1010 EXTERN bool embedded_mode INIT(= false);
1011 // Do not start a UI nor read/write to stdio (unless embedding).
1012 EXTERN bool headless_mode INIT(= false);
1013 
1014 // uncrustify:on
1015 
1018 typedef enum {
1022 } WorkingStatus;
1023 
1030 typedef enum {
1035 } CdScope;
1036 
1037 #define MIN_CD_SCOPE kCdScopeWindow
1038 #define MAX_CD_SCOPE kCdScopeGlobal
1039 
1041 typedef enum {
1046 } CdCause;
1047 
1048 // Only filled for Win32.
1049 EXTERN char windowsVersion[20] INIT(= { 0 });
1050 
1051 #endif // NVIM_GLOBALS_H
WM_SHOWN
@ WM_SHOWN
wildmenu showing
Definition: globals.h:772
TriState
TriState
Definition: types.h:29
aucmd_win
EXTERN win_T * aucmd_win
Definition: globals.h:440
wim_flags
EXTERN char_u wim_flags[4]
Definition: globals.h:813
window_S
Definition: buffer_defs.h:1164
IOSIZE
#define IOSIZE
Definition: globals.h:17
tabpage_S
Definition: buffer_defs.h:930
sub_nsubs
EXTERN long sub_nsubs
Definition: globals.h:809
MSG_BUF_LEN
#define MSG_BUF_LEN
Definition: globals.h:19
curtab
EXTERN tabpage_T * curtab
Definition: globals.h:451
kCdScopeWindow
@ kCdScopeWindow
Affects one window.
Definition: globals.h:1032
NS
handle_T NS
Definition: types.h:25
ex_eval.h
kCdScopeTabpage
@ kCdScopeTabpage
Affects one tab page.
Definition: globals.h:1033
RedrawingDisabled
RedrawingDisabled
Definition: userfunc.c:1000
sub_nlines
EXTERN linenr_T sub_nlines
Definition: globals.h:810
types.h
current_sctx
current_sctx
Definition: userfunc.c:1098
kCdCauseManual
@ kCdCauseManual
Using :cd, :tcd, :lcd or chdir().
Definition: globals.h:1043
menu.h
vim_ignored
EXTERN int vim_ignored
Definition: globals.h:1007
current_exception
EXTERN except_T * current_exception
Definition: globals.h:271
ru_col
EXTERN int ru_col
Definition: globals.h:481
nvim_stats_s::fsync
int64_t fsync
Definition: globals.h:76
cmdmod
EXTERN cmdmod_T cmdmod
Definition: globals.h:651
msglist
Definition: ex_eval.h:42
CdCause
CdCause
What caused the current directory to change.
Definition: globals.h:1041
kCdCauseOther
@ kCdCauseOther
Definition: globals.h:1042
msg_scroll
msg_scroll
Definition: message.c:2017
WorkingStatus
WorkingStatus
Definition: globals.h:1018
arglist
Definition: buffer_defs.h:295
macros.h
mouse_grid
EXTERN int mouse_grid
Definition: globals.h:399
modified_was_set
EXTERN int modified_was_set
Definition: globals.h:382
DFLT_ROWS
#define DFLT_ROWS
Definition: globals.h:91
NameBuff
EXTERN char_u NameBuff[MAXPATHL]
Buffer for expanding file names.
Definition: globals.h:671
CdScope
CdScope
Definition: globals.h:1030
off_T
off_t off_T
Definition: globals.h:115
disptick_T
uint64_t disptick_T
Definition: buffer_defs.h:102
printer_page_num
EXTERN linenr_T printer_page_num
Definition: globals.h:824
where_paste_started
EXTERN pos_T where_paste_started
Definition: globals.h:538
sc_col
EXTERN int sc_col
Definition: globals.h:483
edit_submode_highl
EXTERN hlf_T edit_submode_highl
Definition: globals.h:186
reg_extmatch
Definition: regexp_defs.h:154
searchcmdlen
EXTERN int searchcmdlen
Definition: globals.h:712
NORMAL
#define NORMAL
Definition: vim.h:48
kCdCauseWindow
@ kCdCauseWindow
Switching to another window.
Definition: globals.h:1044
sctx_T
Definition: typval.h:276
arrow_used
EXTERN int arrow_used
Definition: globals.h:640
syntax_defs.h
growarray
Definition: garray.h:12
kBroken
@ kBroken
Definition: globals.h:1021
mbyte.h
first_tabpage
EXTERN tabpage_T * first_tabpage
Definition: globals.h:449
caller_scope::autocmd_fname
uint8_t * autocmd_fname
Definition: globals.h:351
sourcing_lnum
sourcing_lnum
Definition: userfunc.c:1003
colnr_T
int colnr_T
Column number type.
Definition: pos.h:12
caller_scope
Definition: globals.h:349
NUL
#define NUL
Definition: ascii.h:19
NO_SCREEN
#define NO_SCREEN
Definition: globals.h:81
topframe
EXTERN frame_T * topframe
Definition: globals.h:445
called_emsg
EXTERN int called_emsg
Definition: globals.h:230
os_buf
EXTERN char os_buf[IOSIZE]
Definition: globals.h:679
pos_T
Definition: pos.h:28
kCdScopeGlobal
@ kCdScopeGlobal
Affects the entire Nvim instance.
Definition: globals.h:1034
msg_buf
EXTERN char msg_buf[MSG_BUF_LEN]
Small buffer for messages.
Definition: globals.h:672
WM_SCROLLED
@ WM_SCROLLED
wildmenu showing with scroll
Definition: globals.h:773
msg_col
EXTERN int msg_col
Definition: globals.h:190
SEA_NONE
#define SEA_NONE
Definition: globals.h:659
N_
#define N_(x)
Definition: gettext.h:21
ru_wid
EXTERN int ru_wid
Definition: globals.h:482
search_match_lines
EXTERN linenr_T search_match_lines
Definition: globals.h:366
MAXLNUM
@ MAXLNUM
Definition: pos.h:17
did_emsg
EXTERN int did_emsg
Definition: globals.h:225
cmdline_row
EXTERN int cmdline_row
Definition: globals.h:139
caller_scope::sourcing_name
uint8_t * sourcing_name
Definition: globals.h:351
lastwin
EXTERN win_T * lastwin
Definition: globals.h:421
mouse_row
EXTERN int mouse_row
Definition: globals.h:400
kUnknown
@ kUnknown
Definition: globals.h:1019
INIT
EXTERN struct nvim_stats_s INIT(={ 0, 0 })
PROF_ values.
caller_scope::funccalp
void * funccalp
Definition: globals.h:354
curwin
EXTERN win_T * curwin
Definition: globals.h:438
provider_caller_scope
EXTERN struct caller_scope provider_caller_scope
starttime
EXTERN time_t starttime
Definition: globals.h:1000
Insstart
EXTERN pos_T Insstart
Definition: globals.h:578
WM_LIST
@ WM_LIST
cmdline CTRL-D
Definition: globals.h:774
EXTERN
#define EXTERN
Definition: macros.h:9
stop_insert_mode
EXTERN int stop_insert_mode
Definition: globals.h:693
iconv.h
Insstart_orig
EXTERN pos_T Insstart_orig
Definition: globals.h:584
caller_scope::sourcing_lnum
linenr_T sourcing_lnum
Definition: globals.h:352
caller_scope::autocmd_match
uint8_t * autocmd_match
Definition: globals.h:351
msg_row
EXTERN int msg_row
Definition: globals.h:191
vimvardict
EXTERN dict_T vimvardict
Definition: globals.h:221
loop.h
lastused_tabpage
EXTERN tabpage_T * lastused_tabpage
Definition: globals.h:450
nvim_stats_s::redraw
int64_t redraw
Definition: globals.h:77
globvardict
EXTERN dict_T globvardict
Definition: globals.h:222
langmap_mapchar
EXTERN char_u langmap_mapchar[256]
Definition: globals.h:766
os_defs.h
char_u
unsigned char char_u
Definition: types.h:12
frame_S
Definition: buffer_defs.h:978
cmdmod_T
Definition: ex_cmds_defs.h:215
bufref_T
Definition: buffer_defs.h:13
kWorking
@ kWorking
Definition: globals.h:1020
typebuf_T
Definition: buffer_defs.h:323
nvim_stats_s
Definition: globals.h:75
file_buffer
Definition: buffer_defs.h:516
kCdCauseAuto
@ kCdCauseAuto
On 'autochdir'.
Definition: globals.h:1045
sourcing_name
sourcing_name
Definition: userfunc.c:1017
kCdScopeInvalid
@ kCdScopeInvalid
Definition: globals.h:1031
caller_scope::script_ctx
sctx_T script_ctx
Definition: globals.h:350
did_emsg_syntax
EXTERN bool did_emsg_syntax
Definition: globals.h:228
VIsual_reselect
EXTERN int VIsual_reselect
Whether to restart the selection after a Select-mode mapping or menu.
Definition: globals.h:530
msg_scrolled
EXTERN int msg_scrolled
Definition: globals.h:192
DFLT_COLS
#define DFLT_COLS
Definition: globals.h:90
dict_T
Definition: coverity-model.c:40
VIsual
EXTERN pos_T VIsual
Start position of active Visual selection.
Definition: globals.h:522
firstwin
EXTERN win_T * firstwin
Definition: globals.h:420
MAXPATHL
#define MAXPATHL
Definition: os_defs.h:23
search_match_endcol
EXTERN colnr_T search_match_endcol
Definition: globals.h:367
kNone
@ kNone
Definition: types.h:30
global_alist
EXTERN alist_T global_alist
Definition: globals.h:476
linenr_T
long linenr_T
Definition: pos.h:7
VimMenu
Definition: buffer_defs.h:1142
mouse_col
EXTERN int mouse_col
Definition: globals.h:401
called_vim_beep
EXTERN bool called_vim_beep
Definition: globals.h:227
NULL
return NULL
Definition: eval.c:10355
vim_exception
Definition: ex_eval.h:61
hlf_T
hlf_T
Definition: highlight_defs.h:51
KeyTyped
EXTERN bool KeyTyped
Definition: globals.h:694
KeyStuffed
EXTERN int KeyStuffed
Definition: globals.h:695
caller_scope::autocmd_bufnr
int autocmd_bufnr
Definition: globals.h:353
IObuff
EXTERN char_u IObuff[IOSIZE]
Buffer for sprintf, I/O, etc.
Definition: globals.h:670