aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/globals.h')
-rw-r--r--src/nvim/globals.h98
1 files changed, 48 insertions, 50 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 7c7ce5e65f..96acca4ac7 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -138,14 +138,14 @@ EXTERN int mod_mask INIT(= 0x0); // current key modifiers
// update_screen().
EXTERN int cmdline_row;
-EXTERN int redraw_cmdline INIT(= false); // cmdline must be redrawn
-EXTERN int clear_cmdline INIT(= false); // cmdline must be cleared
-EXTERN int mode_displayed INIT(= false); // mode is being displayed
-EXTERN int cmdline_star INIT(= false); // cmdline is crypted
-EXTERN int redrawing_cmdline INIT(= false); // cmdline is being redrawn
-EXTERN int cmdline_was_last_drawn INIT(= false); // cmdline was last drawn
+EXTERN bool redraw_cmdline INIT(= false); // cmdline must be redrawn
+EXTERN bool clear_cmdline INIT(= false); // cmdline must be cleared
+EXTERN bool mode_displayed INIT(= false); // mode is being displayed
+EXTERN int cmdline_star INIT(= false); // cmdline is encrypted
+EXTERN bool redrawing_cmdline INIT(= false); // cmdline is being redrawn
+EXTERN bool cmdline_was_last_drawn INIT(= false); // cmdline was last drawn
-EXTERN int exec_from_reg INIT(= false); // executing register
+EXTERN bool exec_from_reg INIT(= false); // executing register
// When '$' is included in 'cpoptions' option set:
// When a change command is given that deletes only part of a line, a dollar
@@ -165,7 +165,7 @@ EXTERN int compl_interrupted INIT(= false);
// Set when doing something for completion that may call edit() recursively,
// which is not allowed. Also used to disable folding during completion
-EXTERN int compl_busy INIT(= false);
+EXTERN bool compl_busy INIT(= false);
// List of flags for method of completion.
EXTERN int compl_cont_status INIT(= 0);
@@ -201,23 +201,23 @@ EXTERN bool msg_did_scroll INIT(= false);
EXTERN char_u *keep_msg INIT(= NULL); // msg to be shown after redraw
EXTERN int keep_msg_attr INIT(= 0); // highlight attr for keep_msg
-EXTERN int keep_msg_more INIT(= false); // keep_msg was set by msgmore()
-EXTERN int need_fileinfo INIT(= false); // do fileinfo() after redraw
+EXTERN bool keep_msg_more INIT(= false); // keep_msg was set by msgmore()
+EXTERN bool need_fileinfo INIT(= false); // do fileinfo() after redraw
EXTERN int msg_scroll INIT(= false); // msg_start() will scroll
-EXTERN int msg_didout INIT(= false); // msg_outstr() was used in line
-EXTERN int msg_didany INIT(= false); // msg_outstr() was used at all
-EXTERN int msg_nowait INIT(= false); // don't wait for this msg
+EXTERN bool msg_didout INIT(= false); // msg_outstr() was used in line
+EXTERN bool msg_didany INIT(= false); // msg_outstr() was used at all
+EXTERN bool msg_nowait INIT(= false); // don't wait for this msg
EXTERN int emsg_off INIT(= 0); // don't display errors for now,
// unless 'debug' is set.
-EXTERN int info_message INIT(= false); // printing informative message
+EXTERN bool info_message INIT(= false); // printing informative message
EXTERN bool msg_hist_off INIT(= false); // don't add messages to history
-EXTERN int need_clr_eos INIT(= false); // need to clear text before
+EXTERN bool need_clr_eos INIT(= false); // need to clear text before
// displaying a message.
EXTERN int emsg_skip INIT(= 0); // don't display errors for
// expression that is skipped
EXTERN bool emsg_severe INIT(= false); // use message of next of several
// emsg() calls for throw
-EXTERN int did_endif INIT(= false); // just had ":endif"
+EXTERN bool did_endif INIT(= false); // just had ":endif"
EXTERN dict_T vimvardict; // Dictionary with v: variables
EXTERN dict_T globvardict; // Dictionary with g: variables
/// g: value
@@ -225,25 +225,24 @@ EXTERN dict_T globvardict; // Dictionary with g: variables
EXTERN int did_emsg; // set by emsg() when the message
// is displayed or thrown
EXTERN bool called_vim_beep; // set if vim_beep() is called
-EXTERN int did_emsg_syntax; // did_emsg set because of a
+EXTERN bool did_emsg_syntax; // did_emsg set because of a
// syntax error
EXTERN int called_emsg; // always set by emsg()
EXTERN int ex_exitval INIT(= 0); // exit value for ex mode
EXTERN bool emsg_on_display INIT(= false); // there is an error message
-EXTERN int rc_did_emsg INIT(= false); // vim_regcomp() called emsg()
+EXTERN bool rc_did_emsg INIT(= false); // vim_regcomp() called emsg()
-EXTERN int no_wait_return INIT(= 0); // don't wait for return for now
-EXTERN int need_wait_return INIT(= 0); // need to wait for return later
-EXTERN int did_wait_return INIT(= false); // wait_return() was used and
- // nothing written since then
-EXTERN int need_maketitle INIT(= true); // call maketitle() soon
+EXTERN int no_wait_return INIT(= 0); // don't wait for return for now
+EXTERN bool need_wait_return INIT(= false); // need to wait for return later
+EXTERN bool did_wait_return INIT(= false); // wait_return() was used and
+ // nothing written since then
+EXTERN bool need_maketitle INIT(= true); // call maketitle() soon
EXTERN int quit_more INIT(= false); // 'q' hit at "--more--" msg
-EXTERN int ex_keep_indent INIT(= false); // getexmodeline(): keep indent
EXTERN int vgetc_busy INIT(= 0); // when inside vgetc() then > 0
-EXTERN int didset_vim INIT(= false); // did set $VIM ourselves
-EXTERN int didset_vimruntime INIT(= false); // idem for $VIMRUNTIME
+EXTERN bool didset_vim INIT(= false); // did set $VIM ourselves
+EXTERN bool didset_vimruntime INIT(= false); // idem for $VIMRUNTIME
/// Lines left before a "more" message. Ex mode needs to be able to reset this
/// after you type something.
@@ -369,7 +368,7 @@ EXTERN colnr_T search_match_endcol; // col nr of match end
EXTERN linenr_T search_first_line INIT(= 0); // for :{FIRST},{last}s/pat
EXTERN linenr_T search_last_line INIT(= MAXLNUM); // for :{first},{LAST}s/pat
-EXTERN int no_smartcase INIT(= false); // don't use 'smartcase' once
+EXTERN bool no_smartcase INIT(= false); // don't use 'smartcase' once
EXTERN int need_check_timestamps INIT(= false); // need to check file
// timestamps asap
@@ -450,7 +449,7 @@ EXTERN frame_T *topframe; // top of the window frame tree
EXTERN tabpage_T *first_tabpage;
EXTERN tabpage_T *lastused_tabpage;
EXTERN tabpage_T *curtab;
-EXTERN int redraw_tabline INIT(= false); // need to redraw tabline
+EXTERN bool redraw_tabline INIT(= false); // need to redraw tabline
// Iterates over all tabs in the tab list
# define FOR_ALL_TABS(tp) for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
@@ -502,15 +501,12 @@ EXTERN volatile int full_screen INIT(= false);
/// Non-zero when only "safe" commands are allowed, e.g. when sourcing .exrc or
/// .vimrc in current directory.
-EXTERN int secure INIT(= false);
+EXTERN int secure INIT(= 0);
/// Non-zero when changing text and jumping to another window/buffer is not
/// allowed.
EXTERN int textlock INIT(= 0);
-/// Non-zero when the current buffer can't be changed. Used for FileChangedRO.
-EXTERN int curbuf_lock INIT(= 0);
-
/// Non-zero when no buffer name can be changed, no buffer can be deleted and
/// current directory can't be changed. Used for SwapExists et al.
EXTERN int allbuf_lock INIT(= 0);
@@ -528,6 +524,8 @@ EXTERN pos_T VIsual;
EXTERN int VIsual_active INIT(= false);
/// Whether Select mode is active.
EXTERN int VIsual_select INIT(= false);
+/// Restart Select mode when next cmd finished
+EXTERN int restart_VIsual_select INIT(= 0);
/// Whether to restart the selection after a Select-mode mapping or menu.
EXTERN int VIsual_reselect;
/// Type of Visual mode.
@@ -559,7 +557,7 @@ EXTERN int end_comment_pending INIT(= NUL);
// know that it should not attempt to perform scrollbinding due to the scroll
// that was a result of the ":syncbind." (Otherwise, check_scrollbind() will
// undo some of the work done by ":syncbind.") -ralston
-EXTERN int did_syncbind INIT(= false);
+EXTERN bool did_syncbind INIT(= false);
// This flag is set when a smart indent has been performed. When the next typed
// character is a '{' the inserted tab will be deleted again.
@@ -624,8 +622,8 @@ EXTERN long opcount INIT(= 0); // count for pending operator
EXTERN int motion_force INIT(=0); // motion force for pending operator
// Ex Mode (Q) state
-EXTERN int exmode_active INIT(= 0); // Zero, EXMODE_NORMAL or EXMODE_VIM.
-EXTERN int ex_no_reprint INIT(=false); // No need to print after z or p.
+EXTERN bool exmode_active INIT(= false); // true if Ex mode is active
+EXTERN bool ex_no_reprint INIT(=false); // No need to print after z or p.
EXTERN int reg_recording INIT(= 0); // register for recording or zero
EXTERN int reg_executing INIT(= 0); // register being executed or zero
@@ -646,7 +644,7 @@ EXTERN int arrow_used; // Normally false, set to true after
EXTERN bool ins_at_eol INIT(= false); // put cursor after eol when
// restarting edit after CTRL-O
-EXTERN int no_abbr INIT(= true); // true when no abbreviations loaded
+EXTERN bool no_abbr INIT(= true); // true when no abbreviations loaded
EXTERN int mapped_ctrl_c INIT(= 0); // Modes where CTRL-C is mapped.
@@ -666,7 +664,7 @@ EXTERN bool cmd_silent INIT(= false); // don't echo the command line
EXTERN int swap_exists_action INIT(= SEA_NONE);
// For dialog when swap file already
// exists.
-EXTERN int swap_exists_did_quit INIT(= false);
+EXTERN bool swap_exists_did_quit INIT(= false);
// Selected "quit" at the dialog.
EXTERN char_u IObuff[IOSIZE]; ///< Buffer for sprintf, I/O, etc.
@@ -703,14 +701,14 @@ EXTERN bool do_redraw INIT(= false); // extra redraw once
EXTERN bool must_redraw_pum INIT(= false); // redraw pum. NB: must_redraw
// should also be set.
-EXTERN int need_highlight_changed INIT(= true);
+EXTERN bool need_highlight_changed INIT(= true);
EXTERN FILE *scriptout INIT(= NULL); ///< Stream to write script to.
// volatile because it is used in a signal handler.
EXTERN volatile int got_int INIT(= false); // set to true when interrupt
// signal occurred
-EXTERN int bangredo INIT(= false); // set to true with ! command
+EXTERN bool bangredo INIT(= false); // set to true with ! command
EXTERN int searchcmdlen; // length of previous search cmd
EXTERN int reg_do_extmatch INIT(= 0); // Used when compiling regexp:
// REX_SET to allow \z\(...\),
@@ -720,14 +718,14 @@ EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL);
// Set by vim_regexec() to store \z\(...\) matches
EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL);
-EXTERN int did_outofmem_msg INIT(= false);
+EXTERN bool did_outofmem_msg INIT(= false);
// set after out of memory msg
-EXTERN int did_swapwrite_msg INIT(= false);
+EXTERN bool did_swapwrite_msg INIT(= false);
// set after swap write error msg
EXTERN int global_busy INIT(= 0); // set when :global is executing
-EXTERN int listcmd_busy INIT(= false); // set when :argdo, :windo or
+EXTERN bool listcmd_busy INIT(= false); // set when :argdo, :windo or
// :bufdo is executing
-EXTERN int need_start_insertmode INIT(= false);
+EXTERN bool need_start_insertmode INIT(= false);
// start insert mode soon
EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":)
EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "."
@@ -735,16 +733,16 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline
EXTERN char_u *autocmd_fname INIT(= NULL); // fname for <afile> on cmdline
EXTERN int autocmd_bufnr INIT(= 0); // fnum for <abuf> on cmdline
EXTERN char_u *autocmd_match INIT(= NULL); // name for <amatch> on cmdline
-EXTERN int did_cursorhold INIT(= false); // set when CursorHold t'gerd
+EXTERN bool did_cursorhold INIT(= false); // set when CursorHold t'gerd
EXTERN int postponed_split INIT(= 0); // for CTRL-W CTRL-] command
EXTERN int postponed_split_flags INIT(= 0); // args for win_split()
EXTERN int postponed_split_tab INIT(= 0); // cmdmod.tab
EXTERN int g_do_tagpreview INIT(= 0); // for tag preview commands:
// height of preview window
-EXTERN int g_tag_at_cursor INIT(= false); // whether the tag command comes
- // from the command line (0) or was
- // invoked as a normal command (1)
+EXTERN bool g_tag_at_cursor INIT(= false); // whether the tag command comes
+ // from the command line (0) or was
+ // invoked as a normal command (1)
EXTERN int replace_offset INIT(= 0); // offset for replace_push()
@@ -758,7 +756,7 @@ EXTERN int keep_help_flag INIT(= false); // doing :ta from help file
// everywhere.
EXTERN char_u *empty_option INIT(= (char_u *)"");
-EXTERN int redir_off INIT(= false); // no redirection for a moment
+EXTERN bool redir_off INIT(= false); // no redirection for a moment
EXTERN FILE *redir_fd INIT(= NULL); // message redirection file
EXTERN int redir_reg INIT(= 0); // message redirection register
EXTERN int redir_vname INIT(= 0); // message redirection variable
@@ -792,8 +790,8 @@ extern char_u *compiled_sys;
EXTERN char_u *globaldir INIT(= NULL);
// Whether 'keymodel' contains "stopsel" and "startsel".
-EXTERN int km_stopsel INIT(= false);
-EXTERN int km_startsel INIT(= false);
+EXTERN bool km_stopsel INIT(= false);
+EXTERN bool km_startsel INIT(= false);
EXTERN int cedit_key INIT(= -1); ///< key value of 'cedit' option
EXTERN int cmdwin_type INIT(= 0); ///< type of cmdline window or 0