patch 8.1.2388: using old C style comments
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
diff --git a/src/main.c b/src/main.c
index 387f837..ddb8e38 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,8 +13,8 @@
#ifdef __CYGWIN__
# ifndef MSWIN
# include <cygwin/version.h>
-# include <sys/cygwin.h> /* for cygwin_conv_to_posix_path() and/or
- * cygwin_conv_path() */
+# include <sys/cygwin.h> // for cygwin_conv_to_posix_path() and/or
+ // cygwin_conv_path()
# endif
# include <limits.h>
#endif
@@ -23,12 +23,12 @@
# include "iscygpty.h"
#endif
-/* Values for edit_type. */
-#define EDIT_NONE 0 /* no edit type yet */
-#define EDIT_FILE 1 /* file name argument[s] given, use argument list */
-#define EDIT_STDIN 2 /* read file from stdin */
-#define EDIT_TAG 3 /* tag name argument given, use tagname */
-#define EDIT_QF 4 /* start in quickfix mode */
+// Values for edit_type.
+#define EDIT_NONE 0 // no edit type yet
+#define EDIT_FILE 1 // file name argument[s] given, use argument list
+#define EDIT_STDIN 2 // read file from stdin
+#define EDIT_TAG 3 // tag name argument given, use tagname
+#define EDIT_QF 4 // start in quickfix mode
#if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
static int file_owned(char *fname);
@@ -82,14 +82,14 @@
#define ME_INVALID_ARG 5
};
-#ifndef PROTO /* don't want a prototype for main() */
+#ifndef PROTO // don't want a prototype for main()
-/* Various parameters passed between main() and other functions. */
+// Various parameters passed between main() and other functions.
static mparm_T params;
-#ifndef NO_VIM_MAIN /* skip this for unittests */
+#ifndef NO_VIM_MAIN // skip this for unittests
-static char_u *start_dir = NULL; /* current working dir on startup */
+static char_u *start_dir = NULL; // current working dir on startup
static int has_dash_c_arg = FALSE;
@@ -122,9 +122,9 @@
argc = get_cmd_argsW(&argv);
#endif
- /* Many variables are in "params" so that we can pass them to invoked
- * functions without a lot of arguments. "argc" and "argv" are also
- * copied, so that they can be changed. */
+ // Many variables are in "params" so that we can pass them to invoked
+ // functions without a lot of arguments. "argc" and "argv" are also
+ // copied, so that they can be changed.
vim_memset(¶ms, 0, sizeof(params));
params.argc = argc;
params.argv = argv;
@@ -150,7 +150,7 @@
#endif
#ifdef STARTUPTIME
- /* Need to find "--startuptime" before actually parsing arguments. */
+ // Need to find "--startuptime" before actually parsing arguments.
for (i = 1; i < argc - 1; ++i)
if (STRICMP(argv[i], "--startuptime") == 0)
{
@@ -162,7 +162,7 @@
starttime = time(NULL);
#ifdef CLEAN_RUNTIMEPATH
- /* Need to find "--clean" before actually parsing arguments. */
+ // Need to find "--clean" before actually parsing arguments.
for (i = 1; i < argc; ++i)
if (STRICMP(argv[i], "--clean") == 0)
{
@@ -219,8 +219,8 @@
{
gui.starting = FALSE;
- /* When running "evim" or "gvim -y" we need the menus, exit if we
- * don't have them. */
+ // When running "evim" or "gvim -y" we need the menus, exit if we
+ // don't have them.
if (params.evim_mode)
mch_exit(1);
}
@@ -239,9 +239,9 @@
start_dir = alloc(MAXPATHL);
if (start_dir != NULL)
mch_dirname(start_dir, MAXPATHL);
- /* Temporarily add '(' and ')' to 'isfname'. These are valid
- * filename characters but are excluded from 'isfname' to make
- * "gf" work on a file name in parenthesis (e.g.: see vim.h). */
+ // Temporarily add '(' and ')' to 'isfname'. These are valid
+ // filename characters but are excluded from 'isfname' to make
+ // "gf" work on a file name in parenthesis (e.g.: see vim.h).
do_cmdline_cmd((char_u *)":set isf+=(,)");
alist_expand(NULL, 0);
do_cmdline_cmd((char_u *)":set isf&");
@@ -256,8 +256,8 @@
{
extern void set_alist_count(void);
- /* Remember the number of entries in the argument list. If it changes
- * we don't react on setting 'encoding'. */
+ // Remember the number of entries in the argument list. If it changes
+ // we don't react on setting 'encoding'.
set_alist_count();
}
#endif
@@ -280,10 +280,10 @@
#ifdef FEAT_DIFF
if (params.diff_mode && params.window_count == -1)
- params.window_count = 0; /* open up to 3 windows */
+ params.window_count = 0; // open up to 3 windows
#endif
- /* Don't redraw until much later. */
+ // Don't redraw until much later.
++RedrawingDisabled;
/*
@@ -308,16 +308,16 @@
#endif
#if defined(FEAT_GUI_MAC) && defined(MACOS_X_DARWIN)
- /* When the GUI is started from Finder, need to display messages in a
- * message box. isatty(2) returns TRUE anyway, thus we need to check the
- * name to know we're not started from a terminal. */
+ // When the GUI is started from Finder, need to display messages in a
+ // message box. isatty(2) returns TRUE anyway, thus we need to check the
+ // name to know we're not started from a terminal.
if (gui.starting && (!isatty(2) || strcmp("/dev/console", ttyname(2)) == 0))
{
params.want_full_screen = FALSE;
- /* Avoid always using "/" as the current directory. Note that when
- * started from Finder the arglist will be filled later in
- * HandleODocAE() and "fname" will be NULL. */
+ // Avoid always using "/" as the current directory. Note that when
+ // started from Finder the arglist will be filled later in
+ // HandleODocAE() and "fname" will be NULL.
if (getcwd((char *)NameBuff, MAXPATHL) != NULL
&& STRCMP(NameBuff, "/") == 0)
{
@@ -368,8 +368,8 @@
check_tty(¶ms);
#ifdef _IOLBF
- /* Ensure output works usefully without a tty: buffer lines instead of
- * fully buffered. */
+ // Ensure output works usefully without a tty: buffer lines instead of
+ // fully buffered.
if (silent_mode)
setvbuf(stdout, NULL, _IOLBF, 0);
#endif
@@ -381,54 +381,54 @@
if (params.want_full_screen && !silent_mode)
{
- termcapinit(params.term); /* set terminal name and get terminal
- capabilities (will set full_screen) */
- screen_start(); /* don't know where cursor is now */
+ termcapinit(params.term); // set terminal name and get terminal
+ // capabilities (will set full_screen)
+ screen_start(); // don't know where cursor is now
TIME_MSG("Termcap init");
}
/*
* Set the default values for the options that use Rows and Columns.
*/
- ui_get_shellsize(); /* inits Rows and Columns */
+ ui_get_shellsize(); // inits Rows and Columns
win_init_size();
#ifdef FEAT_DIFF
- /* Set the 'diff' option now, so that it can be checked for in a .vimrc
- * file. There is no buffer yet though. */
+ // Set the 'diff' option now, so that it can be checked for in a .vimrc
+ // file. There is no buffer yet though.
if (params.diff_mode)
diff_win_options(firstwin, FALSE);
#endif
cmdline_row = Rows - p_ch;
msg_row = cmdline_row;
- screenalloc(FALSE); /* allocate screen buffers */
+ screenalloc(FALSE); // allocate screen buffers
set_init_2();
TIME_MSG("inits 2");
msg_scroll = TRUE;
no_wait_return = TRUE;
- init_mappings(); /* set up initial mappings */
+ init_mappings(); // set up initial mappings
- init_highlight(TRUE, FALSE); /* set the default highlight groups */
+ init_highlight(TRUE, FALSE); // set the default highlight groups
TIME_MSG("init highlight");
#ifdef FEAT_EVAL
- /* Set the break level after the terminal is initialized. */
+ // Set the break level after the terminal is initialized.
debug_break_level = params.use_debug_break_level;
#endif
- /* Reset 'loadplugins' for "-u NONE" before "--cmd" arguments.
- * Allows for setting 'loadplugins' there. */
+ // Reset 'loadplugins' for "-u NONE" before "--cmd" arguments.
+ // Allows for setting 'loadplugins' there.
if (params.use_vimrc != NULL
&& (STRCMP(params.use_vimrc, "NONE") == 0
|| STRCMP(params.use_vimrc, "DEFAULTS") == 0))
p_lpl = FALSE;
- /* Execute --cmd arguments. */
+ // Execute --cmd arguments.
exe_pre_commands(¶ms);
- /* Source startup scripts. */
+ // Source startup scripts.
source_startup_scripts(¶ms);
#ifdef FEAT_MZSCHEME
@@ -444,8 +444,8 @@
return vim_main2();
#endif
}
-#endif /* NO_VIM_MAIN */
-#endif /* PROTO */
+#endif // NO_VIM_MAIN
+#endif // PROTO
/*
* vim_main2() is needed for FEAT_MZSCHEME, but we define it always to keep
@@ -465,11 +465,11 @@
{
char_u *rtp_copy = NULL;
- /* First add all package directories to 'runtimepath', so that their
- * autoload directories can be found. Only if not done already with a
- * :packloadall command.
- * Make a copy of 'runtimepath', so that source_runtime does not use
- * the pack directories. */
+ // First add all package directories to 'runtimepath', so that their
+ // autoload directories can be found. Only if not done already with a
+ // :packloadall command.
+ // Make a copy of 'runtimepath', so that source_runtime does not use
+ // the pack directories.
if (!did_source_packages)
{
rtp_copy = vim_strsave(p_rtp);
@@ -477,7 +477,7 @@
}
source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy,
-# ifdef VMS /* Somehow VMS doesn't handle the "**". */
+# ifdef VMS // Somehow VMS doesn't handle the "**".
(char_u *)"plugin/*.vim",
# else
(char_u *)"plugin/**/*.vim",
@@ -486,13 +486,13 @@
TIME_MSG("loading plugins");
vim_free(rtp_copy);
- /* Only source "start" packages if not done already with a :packloadall
- * command. */
+ // Only source "start" packages if not done already with a :packloadall
+ // command.
if (!did_source_packages)
load_start_packages();
TIME_MSG("loading packages");
-# ifdef VMS /* Somehow VMS doesn't handle the "**". */
+# ifdef VMS // Somehow VMS doesn't handle the "**".
source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_AFTER);
# else
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_AFTER);
@@ -503,13 +503,13 @@
#endif
#ifdef FEAT_DIFF
- /* Decide about window layout for diff mode after reading vimrc. */
+ // Decide about window layout for diff mode after reading vimrc.
if (params.diff_mode && params.window_layout == 0)
{
if (diffopt_horizontal())
- params.window_layout = WIN_HOR; /* use horizontal split */
+ params.window_layout = WIN_HOR; // use horizontal split
else
- params.window_layout = WIN_VER; /* use vertical split */
+ params.window_layout = WIN_VER; // use vertical split
}
#endif
@@ -542,17 +542,17 @@
if (gui.starting)
{
# if defined(UNIX) || defined(VMS)
- /* When something caused a message from a vimrc script, need to output
- * an extra newline before the shell prompt. */
+ // When something caused a message from a vimrc script, need to output
+ // an extra newline before the shell prompt.
if (did_emsg || msg_didout)
putchar('\n');
# endif
- gui_start(NULL); /* will set full_screen to TRUE */
+ gui_start(NULL); // will set full_screen to TRUE
TIME_MSG("starting GUI");
- /* When running "evim" or "gvim -y" we need the menus, exit if we
- * don't have them. */
+ // When running "evim" or "gvim -y" we need the menus, exit if we
+ // don't have them.
if (!gui.in_use && params.evim_mode)
mch_exit(1);
}
@@ -570,7 +570,7 @@
}
#endif
#ifdef FEAT_EVAL
- /* It's better to make v:oldfiles an empty list than NULL. */
+ // It's better to make v:oldfiles an empty list than NULL.
if (get_vim_var_list(VV_OLDFILES) == NULL)
set_vim_var_list(VV_OLDFILES, list_alloc());
#endif
@@ -632,7 +632,7 @@
#endif
#ifdef FEAT_XCLIPBOARD
- /* Start using the X clipboard, unless the GUI was started. */
+ // Start using the X clipboard, unless the GUI was started.
# ifdef FEAT_GUI
if (!gui.in_use)
# endif
@@ -643,7 +643,7 @@
#endif
#ifdef FEAT_CLIENTSERVER
- /* Prepare for being a Vim server. */
+ // Prepare for being a Vim server.
prepare_server(¶ms);
#endif
@@ -658,8 +658,8 @@
read_stdin();
#if defined(UNIX) || defined(VMS)
- /* When switching screens and something caused a message from a vimrc
- * script, need to output an extra newline on exit. */
+ // When switching screens and something caused a message from a vimrc
+ // script, need to output an extra newline on exit.
if ((did_emsg || msg_didout) && *T_TI != NUL)
newline_on_exit = TRUE;
#endif
@@ -681,13 +681,13 @@
TIME_MSG("waiting for return");
}
- starttermcap(); /* start termcap if not done by wait_return() */
+ starttermcap(); // start termcap if not done by wait_return()
TIME_MSG("start termcap");
setmouse(); // may start using the mouse
if (scroll_region)
- scroll_region_reset(); /* In case Rows changed */
- scroll_start(); /* may scroll the screen to the right position */
+ scroll_region_reset(); // In case Rows changed
+ scroll_start(); // may scroll the screen to the right position
#if defined(FEAT_TITLE) && (defined(UNIX) || defined(VMS) || defined(MACOS_X))
term_push_title(SAVE_RESTORE_BOTH);
@@ -704,7 +704,7 @@
must_redraw = CLEAR;
else
{
- screenclear(); /* clear screen */
+ screenclear(); // clear screen
TIME_MSG("clearing screen");
}
@@ -727,11 +727,11 @@
TIME_MSG("opening buffers");
#ifdef FEAT_EVAL
- /* clear v:swapcommand */
+ // clear v:swapcommand
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
#endif
- /* Ex starts at last line of the file */
+ // Ex starts at last line of the file
if (exmode_active)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
@@ -762,7 +762,7 @@
{
win_T *wp;
- /* set options in each window for "vimdiff". */
+ // set options in each window for "vimdiff".
FOR_ALL_WINDOWS(wp)
diff_win_options(wp, TRUE);
}
@@ -785,20 +785,20 @@
do_cmdline_cmd(IObuff);
TIME_MSG("jumping to tag");
- /* If the user doesn't want to edit the file then we quit here. */
+ // If the user doesn't want to edit the file then we quit here.
if (swap_exists_did_quit)
getout(1);
}
- /* Execute any "+", "-c" and "-S" arguments. */
+ // Execute any "+", "-c" and "-S" arguments.
if (params.n_commands > 0)
exe_commands(¶ms);
- /* Must come before the may_req_ calls. */
+ // Must come before the may_req_ calls.
starting = 0;
#if defined(FEAT_TERMRESPONSE)
- /* Must be done before redrawing, puts a few characters on the screen. */
+ // Must be done before redrawing, puts a few characters on the screen.
may_req_ambiguous_char_width();
#endif
@@ -806,18 +806,18 @@
redraw_all_later(NOT_VALID);
no_wait_return = FALSE;
- /* 'autochdir' has been postponed */
+ // 'autochdir' has been postponed
DO_AUTOCHDIR;
#ifdef FEAT_TERMRESPONSE
- /* Requesting the termresponse is postponed until here, so that a "-c q"
- * argument doesn't make it appear in the shell Vim was started from. */
+ // Requesting the termresponse is postponed until here, so that a "-c q"
+ // argument doesn't make it appear in the shell Vim was started from.
may_req_termresponse();
may_req_bg_color();
#endif
- /* start in insert mode */
+ // start in insert mode
if (p_im)
need_start_insertmode = TRUE;
@@ -828,10 +828,10 @@
TIME_MSG("VimEnter autocommands");
#if defined(FEAT_EVAL) && defined(FEAT_CLIPBOARD)
- /* Adjust default register name for "unnamed" in 'clipboard'. Can only be
- * done after the clipboard is available and all initial commands that may
- * modify the 'clipboard' setting have run; i.e. just before entering the
- * main loop. */
+ // Adjust default register name for "unnamed" in 'clipboard'. Can only be
+ // done after the clipboard is available and all initial commands that may
+ // modify the 'clipboard' setting have run; i.e. just before entering the
+ // main loop.
{
int default_regname = 0;
@@ -841,8 +841,8 @@
#endif
#if defined(FEAT_DIFF)
- /* When a startup script or session file setup for diff'ing and
- * scrollbind, sync the scrollbind now. */
+ // When a startup script or session file setup for diff'ing and
+ // scrollbind, sync the scrollbind now.
if (curwin->w_p_diff && curwin->w_p_scb)
{
update_topline();
@@ -855,12 +855,12 @@
# ifdef VIMDLL
if (!gui.in_use)
# endif
- mch_set_winsize_now(); /* Allow winsize changes from now on */
+ mch_set_winsize_now(); // Allow winsize changes from now on
#endif
#if defined(FEAT_GUI)
- /* When tab pages were created, may need to update the tab pages line and
- * scrollbars. This is skipped while creating them. */
+ // When tab pages were created, may need to update the tab pages line and
+ // scrollbars. This is skipped while creating them.
if (first_tabpage->tp_next != NULL)
{
out_flush();
@@ -870,8 +870,8 @@
need_mouse_correct = TRUE;
#endif
- /* If ":startinsert" command used, stuff a dummy command to be able to
- * call normal_cmd(), which will then start Insert mode. */
+ // If ":startinsert" command used, stuff a dummy command to be able to
+ // call normal_cmd(), which will then start Insert mode.
if (restart_edit != 0)
stuffcharReadbuff(K_NOP);
@@ -888,7 +888,7 @@
}
# endif
# endif
- /* Tell the client that it can start sending commands. */
+ // Tell the client that it can start sending commands.
netbeans_open(netbeansArg + 3, TRUE);
}
#endif
@@ -900,7 +900,7 @@
*/
main_loop(FALSE, FALSE);
-#endif /* NO_VIM_MAIN */
+#endif // NO_VIM_MAIN
return 0;
}
@@ -913,16 +913,16 @@
{
cmdline_init();
- (void)mb_init(); /* init mb_bytelen_tab[] to ones */
+ (void)mb_init(); // init mb_bytelen_tab[] to ones
#ifdef FEAT_EVAL
- eval_init(); /* init global variables */
+ eval_init(); // init global variables
#endif
#ifdef __QNXNTO__
- qnx_init(); /* PhAttach() for clipboard, (and gui) */
+ qnx_init(); // PhAttach() for clipboard, (and gui)
#endif
- /* Init the table of Normal mode commands. */
+ // Init the table of Normal mode commands.
init_normal_cmds();
/*
@@ -935,8 +935,8 @@
TIME_MSG("Allocated generic buffers");
#ifdef NBDEBUG
- /* Wait a moment for debugging NetBeans. Must be after allocating
- * NameBuff. */
+ // Wait a moment for debugging NetBeans. Must be after allocating
+ // NameBuff.
nbdebug_log_init("SPRO_GVIM_DEBUG", "SPRO_GVIM_DLEVEL");
nbdebug_wait(WT_ENV | WT_WAIT | WT_STOP, "SPRO_GVIM_WAIT", 20);
TIME_MSG("NetBeans debug wait");
@@ -953,7 +953,7 @@
#endif
#ifdef FEAT_GUI
- gui.dofork = TRUE; /* default is to use fork() */
+ gui.dofork = TRUE; // default is to use fork()
#endif
/*
@@ -966,13 +966,13 @@
early_arg_scan(paramp);
#if defined(FEAT_GUI)
- /* Prepare for possibly starting GUI sometime */
+ // Prepare for possibly starting GUI sometime
gui_prepare(¶mp->argc, paramp->argv);
TIME_MSG("GUI prepared");
#endif
#ifdef FEAT_CLIPBOARD
- clip_init(FALSE); /* Initialise clipboard stuff */
+ clip_init(FALSE); // Initialise clipboard stuff
TIME_MSG("clipboard setup");
#endif
@@ -992,9 +992,9 @@
if (win_alloc_first() == FAIL)
mch_exit(0);
- init_yank(); /* init yank buffers */
+ init_yank(); // init yank buffers
- alist_init(&global_alist); /* Init the argument list to empty. */
+ alist_init(&global_alist); // Init the argument list to empty.
global_alist.id = 0;
/*
@@ -1004,7 +1004,7 @@
* msg_outtrans_len_attr().
* First find out the home directory, needed to expand "~" in options.
*/
- init_homedir(); /* find real value of $HOME */
+ init_homedir(); // find real value of $HOME
set_init_1(paramp->clean);
TIME_MSG("inits 1");
@@ -1156,8 +1156,8 @@
*/
void
main_loop(
- int cmdwin, /* TRUE when working in the command-line window */
- int noexmode) /* TRUE when return on entering Ex mode */
+ int cmdwin, // TRUE when working in the command-line window
+ int noexmode) // TRUE when return on entering Ex mode
{
oparg_T oa; // operator arguments
oparg_T *prev_oap; // operator arguments
@@ -1173,10 +1173,10 @@
current_oap = &oa;
#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
- /* Setup to catch a terminating error from the X server. Just ignore
- * it, restore the state and continue. This might not always work
- * properly, but at least we don't exit unexpectedly when the X server
- * exits while Vim is running in a console. */
+ // Setup to catch a terminating error from the X server. Just ignore
+ // it, restore the state and continue. This might not always work
+ // properly, but at least we don't exit unexpectedly when the X server
+ // exits while Vim is running in a console.
if (!cmdwin && !noexmode && SETJMP(x_jump_env))
{
State = NORMAL;
@@ -1213,36 +1213,36 @@
did_check_timestamps = FALSE;
if (need_check_timestamps)
check_timestamps(FALSE);
- if (need_wait_return) /* if wait_return still needed ... */
- wait_return(FALSE); /* ... call it now */
+ if (need_wait_return) // if wait_return still needed ...
+ wait_return(FALSE); // ... call it now
if (need_start_insertmode && goto_im() && !VIsual_active)
{
need_start_insertmode = FALSE;
- stuffReadbuff((char_u *)"i"); /* start insert mode next */
- /* skip the fileinfo message now, because it would be shown
- * after insert mode finishes! */
+ stuffReadbuff((char_u *)"i"); // start insert mode next
+ // skip the fileinfo message now, because it would be shown
+ // after insert mode finishes!
need_fileinfo = FALSE;
}
}
- /* Reset "got_int" now that we got back to the main loop. Except when
- * inside a ":g/pat/cmd" command, then the "got_int" needs to abort
- * the ":g" command.
- * For ":g/pat/vi" we reset "got_int" when used once. When used
- * a second time we go back to Ex mode and abort the ":g" command. */
+ // Reset "got_int" now that we got back to the main loop. Except when
+ // inside a ":g/pat/cmd" command, then the "got_int" needs to abort
+ // the ":g" command.
+ // For ":g/pat/vi" we reset "got_int" when used once. When used
+ // a second time we go back to Ex mode and abort the ":g" command.
if (got_int)
{
if (noexmode && global_busy && !exmode_active && previous_got_int)
{
- /* Typed two CTRL-C in a row: go back to ex mode as if "Q" was
- * used and keep "got_int" set, so that it aborts ":g". */
+ // Typed two CTRL-C in a row: go back to ex mode as if "Q" was
+ // used and keep "got_int" set, so that it aborts ":g".
exmode_active = EXMODE_NORMAL;
State = NORMAL;
}
else if (!global_busy || !exmode_active)
{
if (!quit_more)
- (void)vgetc(); /* flush all buffers */
+ (void)vgetc(); // flush all buffers
got_int = FALSE;
}
previous_got_int = TRUE;
@@ -1280,7 +1280,7 @@
conceal_update_lines = FALSE;
#endif
- /* Trigger CursorMoved if the cursor moved. */
+ // Trigger CursorMoved if the cursor moved.
if (!finish_op && (
has_cursormoved()
#ifdef FEAT_PROP_POPUP
@@ -1327,7 +1327,7 @@
}
#endif
- /* Trigger TextChanged if b:changedtick differs. */
+ // Trigger TextChanged if b:changedtick differs.
if (!finish_op && has_textchanged()
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf))
{
@@ -1349,8 +1349,8 @@
curtab->tp_diff_update = FALSE;
}
- /* Scroll-binding for diff mode may have been postponed until
- * here. Avoids doing it for every change. */
+ // Scroll-binding for diff mode may have been postponed until
+ // here. Avoids doing it for every change.
if (diff_need_scrollbind)
{
check_scrollbind((linenr_T)0, 0L);
@@ -1358,7 +1358,7 @@
}
#endif
#if defined(FEAT_FOLDING)
- /* Include a closed fold completely in the Visual area. */
+ // Include a closed fold completely in the Visual area.
foldAdjustVisual();
#endif
#ifdef FEAT_FOLDING
@@ -1410,7 +1410,7 @@
#ifdef FEAT_VIMINFO
curbuf->b_last_used = vim_time();
#endif
- /* display message after redraw */
+ // display message after redraw
if (keep_msg != NULL)
{
char_u *p = vim_strsave(keep_msg);
@@ -1427,16 +1427,16 @@
vim_free(p);
}
}
- if (need_fileinfo) /* show file info after redraw */
+ if (need_fileinfo) // show file info after redraw
{
fileinfo(FALSE, TRUE, FALSE);
need_fileinfo = FALSE;
}
- emsg_on_display = FALSE; /* can delete error message now */
+ emsg_on_display = FALSE; // can delete error message now
did_emsg = FALSE;
- msg_didany = FALSE; /* reset lines_left in msg_start() */
- may_clear_sb_text(); /* clear scroll-back text on next msg */
+ msg_didany = FALSE; // reset lines_left in msg_start()
+ may_clear_sb_text(); // clear scroll-back text on next msg
showruler(FALSE);
setcursor();
@@ -1445,8 +1445,8 @@
do_redraw = FALSE;
#ifdef STARTUPTIME
- /* Now that we have drawn the first screen all the startup stuff
- * has been done, close any file for startup messages. */
+ // Now that we have drawn the first screen all the startup stuff
+ // has been done, close any file for startup messages.
if (time_fd != NULL)
{
TIME_MSG("first screen update");
@@ -1483,7 +1483,7 @@
*/
if (exmode_active)
{
- if (noexmode) /* End of ":global/path/visual" commands */
+ if (noexmode) // End of ":global/path/visual" commands
goto theend;
do_exmode(exmode_active == EXMODE_VIM);
}
@@ -1495,9 +1495,9 @@
&& !VIsual_active
&& !skip_term_loop)
{
- /* If terminal_loop() returns OK we got a key that is handled
- * in Normal model. With FAIL we first need to position the
- * cursor and the screen needs to be redrawn. */
+ // If terminal_loop() returns OK we got a key that is handled
+ // in Normal model. With FAIL we first need to position the
+ // cursor and the screen needs to be redrawn.
if (terminal_loop(TRUE) == OK)
normal_cmd(&oa, TRUE);
}
@@ -1525,16 +1525,16 @@
getout_preserve_modified(int exitval)
{
# if defined(SIGHUP) && defined(SIG_IGN)
- /* Ignore SIGHUP, because a dropped connection causes a read error, which
- * makes Vim exit and then handling SIGHUP causes various reentrance
- * problems. */
+ // Ignore SIGHUP, because a dropped connection causes a read error, which
+ // makes Vim exit and then handling SIGHUP causes various reentrance
+ // problems.
signal(SIGHUP, SIG_IGN);
# endif
- ml_close_notmod(); /* close all not-modified buffers */
- ml_sync_all(FALSE, FALSE); /* preserve all swap files */
- ml_close_all(FALSE); /* close all memfiles, without deleting */
- getout(exitval); /* exit Vim properly */
+ ml_close_notmod(); // close all not-modified buffers
+ ml_sync_all(FALSE, FALSE); // preserve all swap files
+ ml_close_all(FALSE); // close all memfiles, without deleting
+ getout(exitval); // exit Vim properly
}
#endif
@@ -1550,20 +1550,20 @@
ch_log(NULL, "Exiting...");
#endif
- /* When running in Ex mode an error causes us to exit with a non-zero exit
- * code. POSIX requires this, although it's not 100% clear from the
- * standard. */
+ // When running in Ex mode an error causes us to exit with a non-zero exit
+ // code. POSIX requires this, although it's not 100% clear from the
+ // standard.
if (exmode_active)
exitval += ex_exitval;
- /* Position the cursor on the last screen line, below all the text */
+ // Position the cursor on the last screen line, below all the text
#ifdef FEAT_GUI
if (!gui.in_use)
#endif
windgoto((int)Rows - 1, 0);
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL)
- /* Optionally print hashtable efficiency. */
+ // Optionally print hashtable efficiency.
hash_debug_results();
#endif
@@ -1578,14 +1578,14 @@
buf_T *buf;
win_T *wp;
- /* Trigger BufWinLeave for all windows, but only once per buffer. */
+ // Trigger BufWinLeave for all windows, but only once per buffer.
for (tp = first_tabpage; tp != NULL; tp = next_tp)
{
next_tp = tp->tp_next;
FOR_ALL_WINDOWS_IN_TAB(tp, wp)
{
if (wp->w_buffer == NULL)
- /* Autocmd must have close the buffer already, skip. */
+ // Autocmd must have close the buffer already, skip.
continue;
buf = wp->w_buffer;
if (CHANGEDTICK(buf) != -1)
@@ -1596,16 +1596,16 @@
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname,
buf->b_fname, FALSE, buf);
if (bufref_valid(&bufref))
- CHANGEDTICK(buf) = -1; /* note we did it already */
+ CHANGEDTICK(buf) = -1; // note we did it already
- /* start all over, autocommands may mess up the lists */
+ // start all over, autocommands may mess up the lists
next_tp = first_tabpage;
break;
}
}
}
- /* Trigger BufUnload for buffers that are loaded */
+ // Trigger BufUnload for buffers that are loaded
FOR_ALL_BUFFERS(buf)
if (buf->b_ml.ml_mfp != NULL)
{
@@ -1615,7 +1615,7 @@
apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname,
FALSE, buf);
if (!bufref_valid(&bufref))
- /* autocmd deleted the buffer */
+ // autocmd deleted the buffer
break;
}
apply_autocmds(EVENT_VIMLEAVEPRE, NULL, NULL, FALSE, curbuf);
@@ -1623,7 +1623,7 @@
#ifdef FEAT_VIMINFO
if (*p_viminfo != NUL)
- /* Write out the registers, history, marks etc, to the viminfo file */
+ // Write out the registers, history, marks etc, to the viminfo file
write_viminfo(NULL, FALSE);
#endif
@@ -1652,12 +1652,12 @@
#endif
)
{
- /* give the user a chance to read the (error) message */
+ // give the user a chance to read the (error) message
no_wait_return = FALSE;
wait_return(FALSE);
}
- /* Position the cursor again, the autocommands may have moved it */
+ // Position the cursor again, the autocommands may have moved it
#ifdef FEAT_GUI
if (!gui.in_use)
#endif
@@ -1717,18 +1717,18 @@
setlocale(LC_ALL, "");
# ifdef FEAT_GUI_GTK
- /* Tell Gtk not to change our locale settings. */
+ // Tell Gtk not to change our locale settings.
gtk_disable_setlocale();
# endif
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
- /* Make sure strtod() uses a decimal point, not a comma. */
+ // Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
# ifdef MSWIN
- /* Apparently MS-Windows printf() may cause a crash when we give it 8-bit
- * text while it's expecting text in the current locale. This call avoids
- * that. */
+ // Apparently MS-Windows printf() may cause a crash when we give it 8-bit
+ // text while it's expecting text in the current locale. This call avoids
+ // that.
setlocale(LC_CTYPE, "C");
# endif
@@ -1738,11 +1738,11 @@
char_u *p;
# ifdef DYNAMIC_GETTEXT
- /* Initialize the gettext library */
+ // Initialize the gettext library
dyn_libintl_init();
# endif
- /* expand_env() doesn't work yet, because g_chartab[] is not
- * initialized yet, call vim_getenv() directly */
+ // expand_env() doesn't work yet, because g_chartab[] is not
+ // initialized yet, call vim_getenv() directly
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (p != NULL && *p != NUL)
{
@@ -1802,7 +1802,7 @@
parmp->serverArg = TRUE;
# ifdef FEAT_GUI
if (strstr(argv[i], "-wait") != 0)
- /* don't fork() when starting the GUI to edit files ourself */
+ // don't fork() when starting the GUI to edit files ourself
gui.dofork = FALSE;
# endif
}
@@ -1857,9 +1857,9 @@
*/
static int
get_number_arg(
- char_u *p, /* pointer to argument */
- int *idx, /* index in argument, is incremented */
- int def) /* default value */
+ char_u *p, // pointer to argument
+ int *idx, // index in argument, is incremented
+ int def) // default value
{
if (vim_isdigit(p[*idx]))
{
@@ -1888,16 +1888,15 @@
initstr = gettail((char_u *)parmp->argv[0]);
#ifdef FEAT_GUI_MAC
- /* An issue has been seen when launching Vim in such a way that
- * $PWD/$ARGV[0] or $ARGV[0] is not the absolute path to the
- * executable or a symbolic link of it. Until this issue is resolved
- * we prohibit the GUI from being used.
- */
+ // An issue has been seen when launching Vim in such a way that
+ // $PWD/$ARGV[0] or $ARGV[0] is not the absolute path to the
+ // executable or a symbolic link of it. Until this issue is resolved
+ // we prohibit the GUI from being used.
if (STRCMP(initstr, parmp->argv[0]) == 0)
disallow_gui = TRUE;
- /* TODO: On MacOS X default to gui if argv[0] ends in:
- * /Vim.app/Contents/MacOS/Vim */
+ // TODO: On MacOS X default to gui if argv[0] ends in:
+ // /Vim.app/Contents/MacOS/Vim
#endif
#ifdef FEAT_EVAL
@@ -1911,7 +1910,7 @@
++initstr;
}
- /* Use evim mode for "evim" and "egvim", not for "editor". */
+ // Use evim mode for "evim" and "egvim", not for "editor".
if (TOLOWER_ASC(initstr[0]) == 'e'
&& (TOLOWER_ASC(initstr[1]) == 'v'
|| TOLOWER_ASC(initstr[1]) == 'g'))
@@ -1923,7 +1922,7 @@
++initstr;
}
- /* "gvim" starts the GUI. Also accept "Gvim" for MS-Windows. */
+ // "gvim" starts the GUI. Also accept "Gvim" for MS-Windows.
if (TOLOWER_ASC(initstr[0]) == 'g')
{
main_start_gui();
@@ -1944,7 +1943,7 @@
{
readonlymode = TRUE;
curbuf->b_p_ro = TRUE;
- p_uc = 10000; /* don't update very often */
+ p_uc = 10000; // don't update very often
initstr += 4;
}
else if (STRNICMP(initstr, "vim", 3) == 0)
@@ -1982,16 +1981,16 @@
{
int argc = parmp->argc;
char **argv = parmp->argv;
- int argv_idx; /* index in argv[n][] */
- int had_minmin = FALSE; /* found "--" argument */
- int want_argument; /* option argument with argument */
+ int argv_idx; // index in argv[n][]
+ int had_minmin = FALSE; // found "--" argument
+ int want_argument; // option argument with argument
int c;
char_u *p = NULL;
long n;
--argc;
++argv;
- argv_idx = 1; /* active option letter is argv[0][argv_idx] */
+ argv_idx = 1; // active option letter is argv[0][argv_idx]
while (argc > 0)
{
/*
@@ -2001,7 +2000,7 @@
{
if (parmp->n_commands >= MAX_ARG_CMDS)
mainerr(ME_EXTRA_CMD, NULL);
- argv_idx = -1; /* skip to next argument */
+ argv_idx = -1; // skip to next argument
if (argv[0][1] == NUL)
parmp->commands[parmp->n_commands++] = (char_u *)"$";
else
@@ -2030,8 +2029,8 @@
#endif
switch (c)
{
- case NUL: /* "vim -" read from stdin */
- /* "ex -" silent mode */
+ case NUL: // "vim -" read from stdin
+ // "ex -" silent mode
if (exmode_active)
silent_mode = TRUE;
else
@@ -2039,27 +2038,27 @@
if (parmp->edit_type != EDIT_NONE)
mainerr(ME_TOO_MANY_ARGS, (char_u *)argv[0]);
parmp->edit_type = EDIT_STDIN;
- read_cmd_fd = 2; /* read from stderr instead of stdin */
+ read_cmd_fd = 2; // read from stderr instead of stdin
}
- argv_idx = -1; /* skip to next argument */
+ argv_idx = -1; // skip to next argument
break;
- case '-': /* "--" don't take any more option arguments */
- /* "--help" give help message */
- /* "--version" give version message */
- /* "--clean" clean context */
- /* "--literal" take files literally */
- /* "--nofork" don't fork */
- /* "--not-a-term" don't warn for not a term */
- /* "--ttyfail" exit if not a term */
- /* "--noplugin[s]" skip plugins */
- /* "--cmd <cmd>" execute cmd before vimrc */
+ case '-': // "--" don't take any more option arguments
+ // "--help" give help message
+ // "--version" give version message
+ // "--clean" clean context
+ // "--literal" take files literally
+ // "--nofork" don't fork
+ // "--not-a-term" don't warn for not a term
+ // "--ttyfail" exit if not a term
+ // "--noplugin[s]" skip plugins
+ // "--cmd <cmd>" execute cmd before vimrc
if (STRICMP(argv[0] + argv_idx, "help") == 0)
usage();
else if (STRICMP(argv[0] + argv_idx, "version") == 0)
{
- Columns = 80; /* need to init Columns */
- info_message = TRUE; /* use mch_msg(), not mch_errmsg() */
+ Columns = 80; // need to init Columns
+ info_message = TRUE; // use mch_msg(), not mch_errmsg()
list_version();
msg_putchar('\n');
msg_didout = FALSE;
@@ -2083,7 +2082,7 @@
else if (STRNICMP(argv[0] + argv_idx, "nofork", 6) == 0)
{
#ifdef FEAT_GUI
- gui.dofork = FALSE; /* don't fork() when starting GUI */
+ gui.dofork = FALSE; // don't fork() when starting GUI
#endif
}
else if (STRNICMP(argv[0] + argv_idx, "noplugin", 8) == 0)
@@ -2104,11 +2103,11 @@
}
#ifdef FEAT_CLIENTSERVER
else if (STRNICMP(argv[0] + argv_idx, "serverlist", 10) == 0)
- ; /* already processed -- no arg */
+ ; // already processed -- no arg
else if (STRNICMP(argv[0] + argv_idx, "servername", 10) == 0
|| STRNICMP(argv[0] + argv_idx, "serversend", 10) == 0)
{
- /* already processed -- snatch the following arg */
+ // already processed -- snatch the following arg
if (argc > 1)
{
--argc;
@@ -2123,7 +2122,7 @@
else if (STRNICMP(argv[0] + argv_idx, "windowid", 8) == 0)
# endif
{
- /* already processed -- snatch the following arg */
+ // already processed -- snatch the following arg
if (argc > 1)
{
--argc;
@@ -2134,7 +2133,7 @@
#ifdef FEAT_GUI_GTK
else if (STRNICMP(argv[0] + argv_idx, "echo-wid", 8) == 0)
{
- /* already processed, skip */
+ // already processed, skip
}
#endif
else
@@ -2144,10 +2143,10 @@
had_minmin = TRUE;
}
if (!want_argument)
- argv_idx = -1; /* skip to next argument */
+ argv_idx = -1; // skip to next argument
break;
- case 'A': /* "-A" start in Arabic mode */
+ case 'A': // "-A" start in Arabic mode
#ifdef FEAT_ARABIC
set_option_value((char_u *)"arabic", 1L, NULL, 0);
#else
@@ -2156,53 +2155,53 @@
#endif
break;
- case 'b': /* "-b" binary mode */
- /* Needs to be effective before expanding file names, because
- * for Win32 this makes us edit a shortcut file itself,
- * instead of the file it links to. */
+ case 'b': // "-b" binary mode
+ // Needs to be effective before expanding file names, because
+ // for Win32 this makes us edit a shortcut file itself,
+ // instead of the file it links to.
set_options_bin(curbuf->b_p_bin, 1, 0);
- curbuf->b_p_bin = 1; /* binary file I/O */
+ curbuf->b_p_bin = 1; // binary file I/O
break;
- case 'C': /* "-C" Compatible */
+ case 'C': // "-C" Compatible
change_compatible(TRUE);
has_dash_c_arg = TRUE;
break;
- case 'e': /* "-e" Ex mode */
+ case 'e': // "-e" Ex mode
exmode_active = EXMODE_NORMAL;
break;
- case 'E': /* "-E" Improved Ex mode */
+ case 'E': // "-E" Improved Ex mode
exmode_active = EXMODE_VIM;
break;
- case 'f': /* "-f" GUI: run in foreground. Amiga: open
- window directly, not with newcli */
+ case 'f': // "-f" GUI: run in foreground. Amiga: open
+ // window directly, not with newcli
#ifdef FEAT_GUI
- gui.dofork = FALSE; /* don't fork() when starting GUI */
+ gui.dofork = FALSE; // don't fork() when starting GUI
#endif
break;
- case 'g': /* "-g" start GUI */
+ case 'g': // "-g" start GUI
main_start_gui();
break;
- case 'F': /* "-F" was for Farsi mode */
+ case 'F': // "-F" was for Farsi mode
mch_errmsg(_(e_nofarsi));
mch_exit(2);
break;
- case '?': /* "-?" give help message (for MS-Windows) */
- case 'h': /* "-h" give help message */
+ case '?': // "-?" give help message (for MS-Windows)
+ case 'h': // "-h" give help message
#ifdef FEAT_GUI_GNOME
- /* Tell usage() to exit for "gvim". */
+ // Tell usage() to exit for "gvim".
gui.starting = FALSE;
#endif
usage();
break;
- case 'H': /* "-H" start in Hebrew mode: rl + hkmap set */
+ case 'H': // "-H" start in Hebrew mode: rl + hkmap set
#ifdef FEAT_RIGHTLEFT
p_hkmap = TRUE;
set_option_value((char_u *)"rl", 1L, NULL, 0);
@@ -2212,132 +2211,132 @@
#endif
break;
- case 'l': /* "-l" lisp mode, 'lisp' and 'showmatch' on */
+ case 'l': // "-l" lisp mode, 'lisp' and 'showmatch' on
#ifdef FEAT_LISP
set_option_value((char_u *)"lisp", 1L, NULL, 0);
p_sm = TRUE;
#endif
break;
- case 'M': /* "-M" no changes or writing of files */
+ case 'M': // "-M" no changes or writing of files
reset_modifiable();
- /* FALLTHROUGH */
+ // FALLTHROUGH
- case 'm': /* "-m" no writing of files */
+ case 'm': // "-m" no writing of files
p_write = FALSE;
break;
- case 'y': /* "-y" easy mode */
+ case 'y': // "-y" easy mode
#ifdef FEAT_GUI
- gui.starting = TRUE; /* start GUI a bit later */
+ gui.starting = TRUE; // start GUI a bit later
#endif
parmp->evim_mode = TRUE;
break;
- case 'N': /* "-N" Nocompatible */
+ case 'N': // "-N" Nocompatible
change_compatible(FALSE);
break;
- case 'n': /* "-n" no swap file */
+ case 'n': // "-n" no swap file
#ifdef FEAT_NETBEANS_INTG
- /* checking for "-nb", netbeans parameters */
+ // checking for "-nb", netbeans parameters
if (argv[0][argv_idx] == 'b')
{
netbeansArg = argv[0];
- argv_idx = -1; /* skip to next argument */
+ argv_idx = -1; // skip to next argument
}
else
#endif
parmp->no_swap_file = TRUE;
break;
- case 'p': /* "-p[N]" open N tab pages */
+ case 'p': // "-p[N]" open N tab pages
#ifdef TARGET_API_MAC_OSX
- /* For some reason on MacOS X, an argument like:
- -psn_0_10223617 is passed in when invoke from Finder
- or with the 'open' command */
+ // For some reason on MacOS X, an argument like:
+ // -psn_0_10223617 is passed in when invoke from Finder
+ // or with the 'open' command
if (argv[0][argv_idx] == 's')
{
- argv_idx = -1; /* bypass full -psn */
+ argv_idx = -1; // bypass full -psn
main_start_gui();
break;
}
#endif
- /* default is 0: open window for each file */
+ // default is 0: open window for each file
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_TABS;
break;
- case 'o': /* "-o[N]" open N horizontal split windows */
- /* default is 0: open window for each file */
+ case 'o': // "-o[N]" open N horizontal split windows
+ // default is 0: open window for each file
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_HOR;
break;
- case 'O': /* "-O[N]" open N vertical split windows */
- /* default is 0: open window for each file */
+ case 'O': // "-O[N]" open N vertical split windows
+ // default is 0: open window for each file
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_VER;
break;
#ifdef FEAT_QUICKFIX
- case 'q': /* "-q" QuickFix mode */
+ case 'q': // "-q" QuickFix mode
if (parmp->edit_type != EDIT_NONE)
mainerr(ME_TOO_MANY_ARGS, (char_u *)argv[0]);
parmp->edit_type = EDIT_QF;
- if (argv[0][argv_idx]) /* "-q{errorfile}" */
+ if (argv[0][argv_idx]) // "-q{errorfile}"
{
parmp->use_ef = (char_u *)argv[0] + argv_idx;
argv_idx = -1;
}
- else if (argc > 1) /* "-q {errorfile}" */
+ else if (argc > 1) // "-q {errorfile}"
want_argument = TRUE;
break;
#endif
- case 'R': /* "-R" readonly mode */
+ case 'R': // "-R" readonly mode
readonlymode = TRUE;
curbuf->b_p_ro = TRUE;
- p_uc = 10000; /* don't update very often */
+ p_uc = 10000; // don't update very often
break;
- case 'r': /* "-r" recovery mode */
- case 'L': /* "-L" recovery mode */
+ case 'r': // "-r" recovery mode
+ case 'L': // "-L" recovery mode
recoverymode = 1;
break;
case 's':
- if (exmode_active) /* "-s" silent (batch) mode */
+ if (exmode_active) // "-s" silent (batch) mode
silent_mode = TRUE;
- else /* "-s {scriptin}" read from script file */
+ else // "-s {scriptin}" read from script file
want_argument = TRUE;
break;
- case 't': /* "-t {tag}" or "-t{tag}" jump to tag */
+ case 't': // "-t {tag}" or "-t{tag}" jump to tag
if (parmp->edit_type != EDIT_NONE)
mainerr(ME_TOO_MANY_ARGS, (char_u *)argv[0]);
parmp->edit_type = EDIT_TAG;
- if (argv[0][argv_idx]) /* "-t{tag}" */
+ if (argv[0][argv_idx]) // "-t{tag}"
{
parmp->tagname = (char_u *)argv[0] + argv_idx;
argv_idx = -1;
}
- else /* "-t {tag}" */
+ else // "-t {tag}"
want_argument = TRUE;
break;
#ifdef FEAT_EVAL
- case 'D': /* "-D" Debugging */
+ case 'D': // "-D" Debugging
parmp->use_debug_break_level = 9999;
break;
#endif
#ifdef FEAT_DIFF
- case 'd': /* "-d" 'diff' */
+ case 'd': // "-d" 'diff'
# ifdef AMIGA
- /* check for "-dev {device}" */
+ // check for "-dev {device}"
if (argv[0][argv_idx] == 'e' && argv[0][argv_idx + 1] == 'v')
want_argument = TRUE;
else
@@ -2345,8 +2344,8 @@
parmp->diff_mode = TRUE;
break;
#endif
- case 'V': /* "-V{N}" Verbose level */
- /* default is 10: a little bit verbose */
+ case 'V': // "-V{N}" Verbose level
+ // default is 10: a little bit verbose
p_verbose = get_number_arg((char_u *)argv[0], &argv_idx, 10);
if (argv[0][argv_idx] != NUL)
{
@@ -2356,15 +2355,15 @@
}
break;
- case 'v': /* "-v" Vi-mode (as if called "vi") */
+ case 'v': // "-v" Vi-mode (as if called "vi")
exmode_active = 0;
#if defined(FEAT_GUI) && !defined(VIMDLL)
- gui.starting = FALSE; /* don't start GUI */
+ gui.starting = FALSE; // don't start GUI
#endif
break;
- case 'w': /* "-w{number}" set window height */
- /* "-w {scriptout}" write to script */
+ case 'w': // "-w{number}" set window height
+ // "-w {scriptout}" write to script
if (vim_isdigit(((char_u *)argv[0])[argv_idx]))
{
n = get_number_arg((char_u *)argv[0], &argv_idx, 10);
@@ -2375,23 +2374,23 @@
break;
#ifdef FEAT_CRYPT
- case 'x': /* "-x" encrypted reading/writing of files */
+ case 'x': // "-x" encrypted reading/writing of files
parmp->ask_for_key = TRUE;
break;
#endif
- case 'X': /* "-X" don't connect to X server */
+ case 'X': // "-X" don't connect to X server
#if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11)
x_no_connect = TRUE;
#endif
break;
- case 'Z': /* "-Z" restricted mode */
+ case 'Z': // "-Z" restricted mode
restricted = TRUE;
break;
- case 'c': /* "-c{command}" or "-c {command}" execute
- command */
+ case 'c': // "-c{command}" or "-c {command}" execute
+ // command
if (argv[0][argv_idx] != NUL)
{
if (parmp->n_commands >= MAX_ARG_CMDS)
@@ -2401,18 +2400,18 @@
argv_idx = -1;
break;
}
- /* FALLTHROUGH */
- case 'S': /* "-S {file}" execute Vim script */
- case 'i': /* "-i {viminfo}" use for viminfo */
+ // FALLTHROUGH
+ case 'S': // "-S {file}" execute Vim script
+ case 'i': // "-i {viminfo}" use for viminfo
#ifndef FEAT_DIFF
- case 'd': /* "-d {device}" device (for Amiga) */
+ case 'd': // "-d {device}" device (for Amiga)
#endif
- case 'T': /* "-T {terminal}" terminal name */
- case 'u': /* "-u {vimrc}" vim inits file */
- case 'U': /* "-U {gvimrc}" gvim inits file */
- case 'W': /* "-W {scriptout}" overwrite */
+ case 'T': // "-T {terminal}" terminal name
+ case 'u': // "-u {vimrc}" vim inits file
+ case 'U': // "-U {gvimrc}" gvim inits file
+ case 'W': // "-W {scriptout}" overwrite
#ifdef FEAT_GUI_MSWIN
- case 'P': /* "-P {parent title}" MDI parent */
+ case 'P': // "-P {parent title}" MDI parent
#endif
want_argument = TRUE;
break;
@@ -2433,15 +2432,15 @@
mainerr(ME_GARBAGE, (char_u *)argv[0]);
--argc;
- if (argc < 1 && c != 'S') /* -S has an optional argument */
+ if (argc < 1 && c != 'S') // -S has an optional argument
mainerr_arg_missing((char_u *)argv[0]);
++argv;
argv_idx = -1;
switch (c)
{
- case 'c': /* "-c {command}" execute command */
- case 'S': /* "-S {file}" execute Vim script */
+ case 'c': // "-c {command}" execute command
+ case 'S': // "-S {file}" execute Vim script
if (parmp->n_commands >= MAX_ARG_CMDS)
mainerr(ME_EXTRA_CMD, NULL);
if (c == 'S')
@@ -2449,13 +2448,13 @@
char *a;
if (argc < 1)
- /* "-S" without argument: use default session file
- * name. */
+ // "-S" without argument: use default session file
+ // name.
a = SESSION_FILE;
else if (argv[0][0] == '-')
{
- /* "-S" followed by another option: use default
- * session file name. */
+ // "-S" followed by another option: use default
+ // session file name.
a = SESSION_FILE;
++argc;
--argv;
@@ -2477,29 +2476,29 @@
case '-':
if (argv[-1][2] == 'c')
{
- /* "--cmd {command}" execute command */
+ // "--cmd {command}" execute command
if (parmp->n_pre_commands >= MAX_ARG_CMDS)
mainerr(ME_EXTRA_CMD, NULL);
parmp->pre_commands[parmp->n_pre_commands++] =
(char_u *)argv[0];
}
- /* "--startuptime <file>" already handled */
+ // "--startuptime <file>" already handled
break;
- /* case 'd': -d {device} is handled in mch_check_win() for the
- * Amiga */
+ // case 'd': -d {device} is handled in mch_check_win() for the
+ // Amiga
#ifdef FEAT_QUICKFIX
- case 'q': /* "-q {errorfile}" QuickFix mode */
+ case 'q': // "-q {errorfile}" QuickFix mode
parmp->use_ef = (char_u *)argv[0];
break;
#endif
- case 'i': /* "-i {viminfo}" use for viminfo */
+ case 'i': // "-i {viminfo}" use for viminfo
set_option_value((char_u *)"vif", 0L, (char_u *)argv[0], 0);
break;
- case 's': /* "-s {scriptin}" read from script file */
+ case 's': // "-s {scriptin}" read from script file
if (scriptin[0] != NULL)
{
scripterror:
@@ -2518,14 +2517,14 @@
mch_exit(2);
}
if (save_typebuf() == FAIL)
- mch_exit(2); /* out of memory */
+ mch_exit(2); // out of memory
break;
- case 't': /* "-t {tag}" */
+ case 't': // "-t {tag}"
parmp->tagname = (char_u *)argv[0];
break;
- case 'T': /* "-T {terminal}" terminal name */
+ case 'T': // "-T {terminal}" terminal name
/*
* The -T term argument is always available and when
* HAVE_TERMLIB is supported it overrides the environment
@@ -2533,24 +2532,24 @@
*/
#ifdef FEAT_GUI
if (term_is_gui((char_u *)argv[0]))
- gui.starting = TRUE; /* start GUI a bit later */
+ gui.starting = TRUE; // start GUI a bit later
else
#endif
parmp->term = (char_u *)argv[0];
break;
- case 'u': /* "-u {vimrc}" vim inits file */
+ case 'u': // "-u {vimrc}" vim inits file
parmp->use_vimrc = (char_u *)argv[0];
break;
- case 'U': /* "-U {gvimrc}" gvim inits file */
+ case 'U': // "-U {gvimrc}" gvim inits file
#ifdef FEAT_GUI
use_gvimrc = (char_u *)argv[0];
#endif
break;
- case 'w': /* "-w {nr}" 'window' value */
- /* "-w {scriptout}" append to script file */
+ case 'w': // "-w {nr}" 'window' value
+ // "-w {scriptout}" append to script file
if (vim_isdigit(*((char_u *)argv[0])))
{
argv_idx = 0;
@@ -2559,8 +2558,8 @@
argv_idx = -1;
break;
}
- /* FALLTHROUGH */
- case 'W': /* "-W {scriptout}" overwrite script file */
+ // FALLTHROUGH
+ case 'W': // "-W {scriptout}" overwrite script file
if (scriptout != NULL)
goto scripterror;
if ((scriptout = mch_fopen(argv[0],
@@ -2574,7 +2573,7 @@
break;
#ifdef FEAT_GUI_MSWIN
- case 'P': /* "-P {parent title}" MDI parent */
+ case 'P': // "-P {parent title}" MDI parent
gui_mch_set_parent(argv[0]);
break;
#endif
@@ -2587,21 +2586,21 @@
*/
else
{
- argv_idx = -1; /* skip to next argument */
+ argv_idx = -1; // skip to next argument
- /* Check for only one type of editing. */
+ // Check for only one type of editing.
if (parmp->edit_type != EDIT_NONE && parmp->edit_type != EDIT_FILE)
mainerr(ME_TOO_MANY_ARGS, (char_u *)argv[0]);
parmp->edit_type = EDIT_FILE;
#ifdef MSWIN
- /* Remember if the argument was a full path before changing
- * slashes to backslashes. */
+ // Remember if the argument was a full path before changing
+ // slashes to backslashes.
if (argv[0][0] != NUL && argv[0][1] == ':' && argv[0][2] == '\\')
parmp->full_path = TRUE;
#endif
- /* Add the file to the global argument list. */
+ // Add the file to the global argument list.
if (ga_grow(&global_alist.al_ga, 1) == FAIL
|| (p = vim_strsave((char_u *)argv[0])) == NULL)
mch_exit(2);
@@ -2643,22 +2642,22 @@
#endif
#ifdef USE_FNAME_CASE
- /* Make the case of the file name match the actual file. */
+ // Make the case of the file name match the actual file.
fname_case(p, 0);
#endif
alist_add(&global_alist, p,
#ifdef EXPAND_FILENAMES
- parmp->literal ? 2 : 0 /* add buffer nr after exp. */
+ parmp->literal ? 2 : 0 // add buffer nr after exp.
#else
- 2 /* add buffer number now and use curbuf */
+ 2 // add buffer number now and use curbuf
#endif
);
#ifdef MSWIN
{
- /* Remember this argument has been added to the argument list.
- * Needed when 'encoding' is changed. */
+ // Remember this argument has been added to the argument list.
+ // Needed when 'encoding' is changed.
used_file_arg(argv[0], parmp->literal, parmp->full_path,
# ifdef FEAT_DIFF
parmp->diff_mode
@@ -2684,8 +2683,8 @@
}
#ifdef FEAT_EVAL
- /* If there is a "+123" or "-c" command, set v:swapcommand to the first
- * one. */
+ // If there is a "+123" or "-c" command, set v:swapcommand to the first
+ // one.
if (parmp->n_commands > 0)
{
p = alloc(STRLEN(parmp->commands[0]) + 3);
@@ -2706,7 +2705,7 @@
static void
check_tty(mparm_T *parmp)
{
- int input_isatty; /* is active input a terminal? */
+ int input_isatty; // is active input a terminal?
input_isatty = mch_input_isatty();
if (exmode_active)
@@ -2716,7 +2715,7 @@
}
else if (parmp->want_full_screen && (!stdout_isatty || !input_isatty)
#ifdef FEAT_GUI
- /* don't want the delay when started from the desktop */
+ // don't want the delay when started from the desktop
&& !gui.starting
#endif
&& !parmp->not_a_term)
@@ -2746,14 +2745,14 @@
&& defined(FEAT_GETTEXT)
char *s, *tofree = NULL;
- /* Set the encoding of the error message based on $LC_ALL or
- * other environment variables instead of 'encoding'.
- * Note that the message is shown on a Cygwin terminal (e.g.
- * mintty) which encoding is based on $LC_ALL or etc., not the
- * current codepage used by normal Win32 console programs. */
+ // Set the encoding of the error message based on $LC_ALL or
+ // other environment variables instead of 'encoding'.
+ // Note that the message is shown on a Cygwin terminal (e.g.
+ // mintty) which encoding is based on $LC_ALL or etc., not the
+ // current codepage used by normal Win32 console programs.
tofree = s = (char *)enc_locale_env(NULL);
if (s == NULL)
- s = "utf-8"; /* Use "utf-8" by default. */
+ s = "utf-8"; // Use "utf-8" by default.
(void)bind_textdomain_codeset(VIMPACKAGE, s);
vim_free(tofree);
# endif
@@ -2818,14 +2817,14 @@
/*
* Create the number of windows that was requested.
*/
- if (parmp->window_count == -1) /* was not set */
+ if (parmp->window_count == -1) // was not set
parmp->window_count = 1;
if (parmp->window_count == 0)
parmp->window_count = GARGCOUNT;
if (parmp->window_count > 1)
{
- /* Don't change the windows if there was a command in .vimrc that
- * already split some windows */
+ // Don't change the windows if there was a command in .vimrc that
+ // already split some windows
if (parmp->window_layout == 0)
parmp->window_layout = WIN_HOR;
if (parmp->window_layout == WIN_TABS)
@@ -2845,13 +2844,13 @@
else
parmp->window_count = 1;
- if (recoverymode) /* do recover */
+ if (recoverymode) // do recover
{
- msg_scroll = TRUE; /* scroll message up */
+ msg_scroll = TRUE; // scroll message up
ml_recover(TRUE);
- if (curbuf->b_ml.ml_mfp == NULL) /* failed */
+ if (curbuf->b_ml.ml_mfp == NULL) // failed
getout(1);
- do_modelines(0); /* do modelines */
+ do_modelines(0); // do modelines
}
else
{
@@ -2892,7 +2891,7 @@
if (curbuf->b_ml.ml_mfp == NULL)
{
#ifdef FEAT_FOLDING
- /* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */
+ // Set 'foldlevel' to 'foldlevelstart' if it's not negative.
if (p_fdls >= 0)
curwin->w_p_fdl = p_fdls;
#endif
@@ -2901,32 +2900,32 @@
set_buflisted(TRUE);
- /* create memfile, read file */
+ // create memfile, read file
(void)open_buffer(FALSE, NULL, 0);
if (swap_exists_action == SEA_QUIT)
{
if (got_int || only_one_window())
{
- /* abort selected or quit and only one window */
- did_emsg = FALSE; /* avoid hit-enter prompt */
+ // abort selected or quit and only one window
+ did_emsg = FALSE; // avoid hit-enter prompt
getout(1);
}
- /* We can't close the window, it would disturb what
- * happens next. Clear the file name and set the arg
- * index to -1 to delete it later. */
+ // We can't close the window, it would disturb what
+ // happens next. Clear the file name and set the arg
+ // index to -1 to delete it later.
setfname(curbuf, NULL, NULL, FALSE);
curwin->w_arg_idx = -1;
swap_exists_action = SEA_NONE;
}
else
handle_swap_exists(NULL);
- dorewind = TRUE; /* start again */
+ dorewind = TRUE; // start again
}
ui_breakcheck();
if (got_int)
{
- (void)vgetc(); /* only break the file loading, not the rest */
+ (void)vgetc(); // only break the file loading, not the rest
break;
}
}
@@ -2947,9 +2946,9 @@
static void
edit_buffers(
mparm_T *parmp,
- char_u *cwd) /* current working dir */
+ char_u *cwd) // current working dir
{
- int arg_idx; /* index in argument list */
+ int arg_idx; // index in argument list
int i;
int advance = TRUE;
win_T *win;
@@ -2961,7 +2960,7 @@
++autocmd_no_enter;
++autocmd_no_leave;
- /* When w_arg_idx is -1 remove the window (see create_windows()). */
+ // When w_arg_idx is -1 remove the window (see create_windows()).
if (curwin->w_arg_idx == -1)
{
win_close(curwin, TRUE);
@@ -2973,7 +2972,7 @@
{
if (cwd != NULL)
mch_chdir((char *)cwd);
- /* When w_arg_idx is -1 remove the window (see create_windows()). */
+ // When w_arg_idx is -1 remove the window (see create_windows()).
if (curwin->w_arg_idx == -1)
{
++arg_idx;
@@ -2986,7 +2985,7 @@
{
if (parmp->window_layout == WIN_TABS)
{
- if (curtab->tp_next == NULL) /* just checking */
+ if (curtab->tp_next == NULL) // just checking
break;
goto_tabpage(0);
// Temporarily reset 'shm' option to not print fileinfo when
@@ -3003,31 +3002,31 @@
}
else
{
- if (curwin->w_next == NULL) /* just checking */
+ if (curwin->w_next == NULL) // just checking
break;
win_enter(curwin->w_next, FALSE);
}
}
advance = TRUE;
- /* Only open the file if there is no file in this window yet (that can
- * happen when .vimrc contains ":sall"). */
+ // Only open the file if there is no file in this window yet (that can
+ // happen when .vimrc contains ":sall").
if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
{
curwin->w_arg_idx = arg_idx;
- /* Edit file from arg list, if there is one. When "Quit" selected
- * at the ATTENTION prompt close the window. */
+ // Edit file from arg list, if there is one. When "Quit" selected
+ // at the ATTENTION prompt close the window.
swap_exists_did_quit = FALSE;
(void)do_ecmd(0, arg_idx < GARGCOUNT
? alist_name(&GARGLIST[arg_idx]) : NULL,
NULL, NULL, ECMD_LASTL, ECMD_HIDE, curwin);
if (swap_exists_did_quit)
{
- /* abort or quit selected */
+ // abort or quit selected
if (got_int || only_one_window())
{
- /* abort selected and only one window */
- did_emsg = FALSE; /* avoid hit-enter prompt */
+ // abort selected and only one window
+ did_emsg = FALSE; // avoid hit-enter prompt
getout(1);
}
win_close(curwin, TRUE);
@@ -3040,7 +3039,7 @@
ui_breakcheck();
if (got_int)
{
- (void)vgetc(); /* only break the file loading, not the rest */
+ (void)vgetc(); // only break the file loading, not the rest
break;
}
}
@@ -3055,10 +3054,10 @@
goto_tabpage(1);
--autocmd_no_enter;
- /* make the first window the current window */
+ // make the first window the current window
win = firstwin;
#if defined(FEAT_QUICKFIX)
- /* Avoid making a preview window the current window. */
+ // Avoid making a preview window the current window.
while (win->w_p_pvw)
{
win = win->w_next;
@@ -3074,7 +3073,7 @@
--autocmd_no_leave;
TIME_MSG("editing files in windows");
if (parmp->window_count > 1 && parmp->window_layout != WIN_TABS)
- win_equal(curwin, FALSE, 'b'); /* adjust heights */
+ win_equal(curwin, FALSE, 'b'); // adjust heights
}
/*
@@ -3089,7 +3088,7 @@
if (cnt > 0)
{
- curwin->w_cursor.lnum = 0; /* just in case.. */
+ curwin->w_cursor.lnum = 0; // just in case..
sourcing_name = (char_u *)_("pre-vimrc command line");
# ifdef FEAT_EVAL
current_sctx.sc_sid = SID_CMDARG;
@@ -3142,7 +3141,7 @@
msg_scroll = FALSE;
#ifdef FEAT_QUICKFIX
- /* When started with "-q errorfile" jump to first error again. */
+ // When started with "-q errorfile" jump to first error again.
if (parmp->edit_type == EDIT_QF)
qf_jump(NULL, 0, 0, FALSE);
#endif
@@ -3179,7 +3178,7 @@
|| STRCMP(parmp->use_vimrc, "NORC") == 0)
{
#ifdef FEAT_GUI
- if (use_gvimrc == NULL) /* don't load gvimrc either */
+ if (use_gvimrc == NULL) // don't load gvimrc either
use_gvimrc = parmp->use_vimrc;
#endif
}
@@ -3195,7 +3194,7 @@
struct Process *proc = (struct Process *)FindTask(0L);
APTR save_winptr = proc->pr_WindowPtr;
- /* Avoid a requester here for a volume that doesn't exist. */
+ // Avoid a requester here for a volume that doesn't exist.
proc->pr_WindowPtr = (APTR)-1L;
#endif
@@ -3241,7 +3240,7 @@
#endif
&& !has_dash_c_arg)
{
- /* When no .vimrc file was found: source defaults.vim. */
+ // When no .vimrc file was found: source defaults.vim.
do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE);
}
}
@@ -3258,7 +3257,7 @@
if (p_exrc)
{
#if defined(UNIX) || defined(VMS)
- /* If ".vimrc" file is not owned by user, set 'secure' mode. */
+ // If ".vimrc" file is not owned by user, set 'secure' mode.
if (!file_owned(VIMRC_FILE))
#endif
secure = p_secure;
@@ -3284,7 +3283,7 @@
if (i == FAIL)
{
#if defined(UNIX) || defined(VMS)
- /* if ".exrc" is not owned by user set 'secure' mode */
+ // if ".exrc" is not owned by user set 'secure' mode
if (!file_owned(EXRC_FILE))
secure = p_secure;
else
@@ -3317,7 +3316,7 @@
main_start_gui(void)
{
#ifdef FEAT_GUI
- gui.starting = TRUE; /* start GUI a bit later */
+ gui.starting = TRUE; // start GUI a bit later
#else
mch_errmsg(_(e_nogvim));
mch_errmsg("\n");
@@ -3325,7 +3324,7 @@
#endif
}
-#endif /* NO_VIM_MAIN */
+#endif // NO_VIM_MAIN
/*
* Get an environment variable, and execute it as Ex commands.
@@ -3334,7 +3333,7 @@
int
process_env(
char_u *env,
- int is_viminit) /* when TRUE, called for VIMINIT */
+ int is_viminit) // when TRUE, called for VIMINIT
{
char_u *initstr;
char_u *save_sourcing_name;
@@ -3381,7 +3380,7 @@
stat_T s;
# ifdef UNIX
uid_t uid = getuid();
-# else /* VMS */
+# else // VMS
uid_t uid = ((getgid() << 16) | getuid());
# endif
@@ -3398,11 +3397,11 @@
*/
static void
mainerr(
- int n, /* one of the ME_ defines */
- char_u *str) /* extra argument or NULL */
+ int n, // one of the ME_ defines
+ char_u *str) // extra argument or NULL
{
#if defined(UNIX) || defined(VMS)
- reset_signals(); /* kill us with CTRL-C here, if you like */
+ reset_signals(); // kill us with CTRL-C here, if you like
#endif
// If this is a Windows GUI executable, show an error dialog box.
@@ -3464,7 +3463,7 @@
};
#if defined(UNIX) || defined(VMS)
- reset_signals(); /* kill us with CTRL-C here, if you like */
+ reset_signals(); // kill us with CTRL-C here, if you like
#endif
init_longVersion();
@@ -3608,7 +3607,7 @@
main_msg(_("-reverse\t\tUse reverse video (also: -rv)"));
main_msg(_("+reverse\t\tDon't use reverse video (also: +rv)"));
main_msg(_("-xrm <resource>\tSet the specified resource"));
-#endif /* FEAT_GUI_X11 */
+#endif // FEAT_GUI_X11
#ifdef FEAT_GUI_GTK
mch_msg(_("\nArguments recognised by gvim (GTK+ version):\n"));
main_msg(_("-font <font>\t\tUse <font> for normal text (also: -fn)"));
@@ -3630,7 +3629,7 @@
#endif
#ifdef FEAT_GUI_GNOME
- /* Gnome gives extra messages for --help if we continue, but not for -h. */
+ // Gnome gives extra messages for --help if we continue, but not for -h.
if (gui.starting)
{
mch_msg("\n");
@@ -3654,7 +3653,7 @@
handle_swap_exists(NULL);
}
-#endif /* NO_VIM_MAIN */
+#endif // NO_VIM_MAIN
#if defined(STARTUPTIME) || defined(PROTO)
static struct timeval prev_timeval;
@@ -3702,7 +3701,7 @@
*/
void
time_pop(
- void *tp) /* actually (struct timeval *) */
+ void *tp) // actually (struct timeval *)
{
prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec;
prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec;
@@ -3728,8 +3727,8 @@
void
time_msg(
char *mesg,
- void *tv_start) /* only for do_source: start time; actually
- (struct timeval *) */
+ void *tv_start) // only for do_source: start time; actually
+ // (struct timeval *)
{
static struct timeval start;
struct timeval now;
@@ -3767,10 +3766,10 @@
char_u *val = argv0;
# ifdef MSWIN
- /* A relative path containing a "/" will become invalid when using ":cd",
- * turn it into a full path.
- * On MS-Windows "vim" should be expanded to "vim.exe", thus always do
- * this. */
+ // A relative path containing a "/" will become invalid when using ":cd",
+ // turn it into a full path.
+ // On MS-Windows "vim" should be expanded to "vim.exe", thus always do
+ // this.
char_u *path = NULL;
if (mch_can_exe(argv0, &path, FALSE) && path != NULL)
@@ -3804,7 +3803,7 @@
# endif
}
-#endif /* NO_VIM_MAIN */
+#endif // NO_VIM_MAIN
#if (defined(FEAT_CLIENTSERVER) && !defined(NO_VIM_MAIN)) || defined(PROTO)
@@ -3823,7 +3822,7 @@
if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL)
{
# ifdef MSWIN
- /* Initialise the client/server messaging infrastructure. */
+ // Initialise the client/server messaging infrastructure.
serverInitMessaging();
# endif
@@ -3839,9 +3838,9 @@
parmp->serverStrEnc = vim_strsave(p_enc);
}
- /* If we're still running, get the name to register ourselves.
- * On Win32 can register right now, for X11 need to setup the
- * clipboard first, it's further down. */
+ // If we're still running, get the name to register ourselves.
+ // On Win32 can register right now, for X11 need to setup the
+ // clipboard first, it's further down.
parmp->servername = serverMakeName(parmp->serverName_arg,
parmp->argv[0]);
# ifdef MSWIN
@@ -3947,7 +3946,7 @@
for (i = 1; i < Argc; i++)
{
res = NULL;
- if (STRCMP(argv[i], "--") == 0) /* end of option arguments */
+ if (STRCMP(argv[i], "--") == 0) // end of option arguments
{
for (; i < *argc; i++)
{
@@ -4006,7 +4005,7 @@
tabs, argtype == ARGTYPE_EDIT_WAIT);
if (*serverStr == NULL)
{
- /* Probably out of memory, exit. */
+ // Probably out of memory, exit.
didone = TRUE;
exiterr = 1;
break;
@@ -4023,28 +4022,28 @@
ret = serverSendToVim(xterm_dpy, sname, *serverStr,
NULL, &srv, 0, 0, 0, silent);
# else
- /* Win32 always works? */
+ // Win32 always works?
ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, 0, silent);
# endif
if (ret < 0)
{
if (argtype == ARGTYPE_SEND)
{
- /* Failed to send, abort. */
+ // Failed to send, abort.
mch_errmsg(_(": Send failed.\n"));
didone = TRUE;
exiterr = 1;
}
else if (!silent)
- /* Let vim start normally. */
+ // Let vim start normally.
mch_errmsg(_(": Send failed. Trying to execute locally\n"));
break;
}
# ifdef FEAT_GUI_MSWIN
- /* Guess that when the server name starts with "g" it's a GUI
- * server, which we can bring to the foreground here.
- * Foreground() in the server doesn't work very well. */
+ // Guess that when the server name starts with "g" it's a GUI
+ // server, which we can bring to the foreground here.
+ // Foreground() in the server doesn't work very well.
if (argtype != ARGTYPE_SEND && TOUPPER_ASC(*sname) == 'G')
SetForegroundWindow(srv);
# endif
@@ -4066,7 +4065,7 @@
# endif
if (numFiles > 0 && argv[i + 1][0] == '+')
- /* Skip "+cmd" argument, don't wait for it to be edited. */
+ // Skip "+cmd" argument, don't wait for it to be edited.
--numFiles;
# ifdef FEAT_GUI_MSWIN
@@ -4079,7 +4078,7 @@
Shell_NotifyIcon(NIM_ADD, &ni);
# endif
- /* Wait for all files to unload in remote */
+ // Wait for all files to unload in remote
vim_memset(done, 0, numFiles);
while (memchr(done, 0, numFiles) != NULL)
{
@@ -4113,7 +4112,7 @@
if (i == *argc - 1)
mainerr_arg_missing((char_u *)argv[i]);
# ifdef MSWIN
- /* Win32 always works? */
+ // Win32 always works?
if (serverSendToVim(sname, (char_u *)argv[i + 1],
&res, NULL, 1, 0, FALSE) < 0)
# else
@@ -4125,7 +4124,7 @@
{
if (res != NULL && *res != NUL)
{
- /* Output error from remote */
+ // Output error from remote
mch_errmsg((char *)res);
VIM_CLEAR(res);
}
@@ -4135,7 +4134,7 @@
else if (STRICMP(argv[i], "--serverlist") == 0)
{
# ifdef MSWIN
- /* Win32 always works? */
+ // Win32 always works?
res = serverGetVimNames();
# else
if (xterm_dpy != NULL)
@@ -4146,7 +4145,7 @@
}
else if (STRICMP(argv[i], "--servername") == 0)
{
- /* Already processed. Take it out of the command line */
+ // Already processed. Take it out of the command line
i++;
continue;
}
@@ -4168,11 +4167,11 @@
if (didone)
{
- display_errors(); /* display any collected messages */
- exit(exiterr); /* Mission accomplished - get out */
+ display_errors(); // display any collected messages
+ exit(exiterr); // Mission accomplished - get out
}
- /* Return back into main() */
+ // Return back into main()
*argc = newArgC;
vim_free(sname);
}
@@ -4184,7 +4183,7 @@
build_drop_cmd(
int filec,
char **filev,
- int tabs, /* Use ":tab drop" instead of ":drop". */
+ int tabs, // Use ":tab drop" instead of ":drop".
int sendReply)
{
garray_T ga;
@@ -4200,11 +4199,11 @@
filev++;
filec--;
}
- /* Check if we have at least one argument. */
+ // Check if we have at least one argument.
if (filec <= 0)
mainerr_arg_missing((char_u *)filev[-1]);
- /* Temporarily cd to the current directory to handle relative file names. */
+ // Temporarily cd to the current directory to handle relative file names.
cwd = alloc(MAXPATHL);
if (cwd == NULL)
return NULL;
@@ -4215,11 +4214,11 @@
}
cdp = vim_strsave_escaped_ext(cwd,
#ifdef BACKSLASH_IN_FILENAME
- (char_u *)"", /* rem_backslash() will tell what chars to escape */
+ (char_u *)"", // rem_backslash() will tell what chars to escape
#else
- PATH_ESC_CHARS,
+ PATH_ESC_CHARS,
#endif
- '\\', TRUE);
+ '\\', TRUE);
vim_free(cwd);
if (cdp == NULL)
return NULL;
@@ -4227,16 +4226,16 @@
ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
ga_concat(&ga, cdp);
- /* Call inputsave() so that a prompt for an encryption key works. */
+ // Call inputsave() so that a prompt for an encryption key works.
ga_concat(&ga, (char_u *)"<CR>:if exists('*inputsave')|call inputsave()|endif|");
if (tabs)
ga_concat(&ga, (char_u *)"tab ");
ga_concat(&ga, (char_u *)"drop");
for (i = 0; i < filec; i++)
{
- /* On Unix the shell has already expanded the wildcards, don't want to
- * do it again in the Vim server. On MS-Windows only escape
- * non-wildcard characters. */
+ // On Unix the shell has already expanded the wildcards, don't want to
+ // do it again in the Vim server. On MS-Windows only escape
+ // non-wildcard characters.
p = vim_strsave_escaped((char_u *)filev[i],
#ifdef UNIX
PATH_ESC_CHARS
@@ -4255,22 +4254,21 @@
}
ga_concat(&ga, (char_u *)"|if exists('*inputrestore')|call inputrestore()|endif<CR>");
- /* The :drop commands goes to Insert mode when 'insertmode' is set, use
- * CTRL-\ CTRL-N again. */
+ // The :drop commands goes to Insert mode when 'insertmode' is set, use
+ // CTRL-\ CTRL-N again.
ga_concat(&ga, (char_u *)"<C-\\><C-N>");
- /* Switch back to the correct current directory (prior to temporary path
- * switch) unless 'autochdir' is set, in which case it will already be
- * correct after the :drop command. With line breaks and spaces:
- * if !exists('+acd') || !&acd
- * if haslocaldir()
- * cd -
- * lcd -
- * elseif getcwd() ==# 'current path'
- * cd -
- * endif
- * endif
- */
+ // Switch back to the correct current directory (prior to temporary path
+ // switch) unless 'autochdir' is set, in which case it will already be
+ // correct after the :drop command. With line breaks and spaces:
+ // if !exists('+acd') || !&acd
+ // if haslocaldir()
+ // cd -
+ // lcd -
+ // elseif getcwd() ==# 'current path'
+ // cd -
+ // endif
+ // endif
ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|if haslocaldir()|");
ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# '");
ga_concat(&ga, cdp);
@@ -4282,14 +4280,14 @@
ga_concat(&ga, (char_u *)":");
if (inicmd != NULL)
{
- /* Can't use <CR> after "inicmd", because an "startinsert" would cause
- * the following commands to be inserted as text. Use a "|",
- * hopefully "inicmd" does allow this... */
+ // Can't use <CR> after "inicmd", because an "startinsert" would cause
+ // the following commands to be inserted as text. Use a "|",
+ // hopefully "inicmd" does allow this...
ga_concat(&ga, inicmd);
ga_concat(&ga, (char_u *)"|");
}
- /* Bring the window to the foreground, goto Insert mode when 'im' set and
- * clear command line. */
+ // Bring the window to the foreground, goto Insert mode when 'im' set and
+ // clear command line.
ga_concat(&ga, (char_u *)"cal foreground()|if &im|star|en|redr|f<CR>");
ga_append(&ga, NUL);
return ga.ga_data;
@@ -4310,13 +4308,13 @@
else
{
p = vim_strsave_up(gettail((char_u *)cmd));
- /* Remove .exe or .bat from the name. */
+ // Remove .exe or .bat from the name.
if (p != NULL && vim_strchr(p, '.') != NULL)
*vim_strchr(p, '.') = NUL;
}
return p;
}
-#endif /* FEAT_CLIENTSERVER */
+#endif // FEAT_CLIENTSERVER
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
/*
@@ -4328,18 +4326,17 @@
char_u *ptr = NULL;
char_u *cpo_save = p_cpo;
- /* Set 'cpoptions' the way we want it.
- * B set - backslashes are *not* treated specially
- * k set - keycodes are *not* reverse-engineered
- * < unset - <Key> sequences *are* interpreted
- * The last but one parameter of replace_termcodes() is TRUE so that the
- * <lt> sequence is recognised - needed for a real backslash.
- */
+ // Set 'cpoptions' the way we want it.
+ // B set - backslashes are *not* treated specially
+ // k set - keycodes are *not* reverse-engineered
+ // < unset - <Key> sequences *are* interpreted
+ // The last but one parameter of replace_termcodes() is TRUE so that the
+ // <lt> sequence is recognised - needed for a real backslash.
p_cpo = (char_u *)"Bk";
str = replace_termcodes((char_u *)str, &ptr, REPTERM_DO_LT, NULL);
p_cpo = cpo_save;
- if (*ptr != NUL) /* trailing CTRL-V results in nothing */
+ if (*ptr != NUL) // trailing CTRL-V results in nothing
{
/*
* Add the string to the input stream.
@@ -4353,8 +4350,8 @@
del_typebuf(typebuf.tb_len - typebuf.tb_maplen, typebuf.tb_maplen);
(void)ins_typebuf(str, REMAP_NONE, typebuf.tb_len, TRUE, FALSE);
- /* Let input_available() know we inserted text in the typeahead
- * buffer. */
+ // Let input_available() know we inserted text in the typeahead
+ // buffer.
typebuf_was_filled = TRUE;
}
vim_free((char_u *)ptr);
@@ -4372,20 +4369,20 @@
funccal_entry_T funccal_entry;
int did_save_funccal = FALSE;
- /* Evaluate the expression at the toplevel, don't use variables local to
- * the calling function. Except when in debug mode. */
+ // Evaluate the expression at the toplevel, don't use variables local to
+ // the calling function. Except when in debug mode.
if (!debug_mode)
{
save_funccal(&funccal_entry);
did_save_funccal = TRUE;
}
- /* Disable debugging, otherwise Vim hangs, waiting for "cont" to be
- * typed. */
+ // Disable debugging, otherwise Vim hangs, waiting for "cont" to be
+ // typed.
debug_break_level = -1;
redir_off = 0;
- /* Do not display error message, otherwise Vim hangs, waiting for "cont"
- * to be typed. Do generate errors so that try/catch works. */
+ // Do not display error message, otherwise Vim hangs, waiting for "cont"
+ // to be typed. Do generate errors so that try/catch works.
++emsg_silent;
res = eval_to_string(expr, NULL, TRUE);
@@ -4398,8 +4395,8 @@
if (did_save_funccal)
restore_funccal();
- /* A client can tell us to redraw, but not to display the cursor, so do
- * that here. */
+ // A client can tell us to redraw, but not to display the cursor, so do
+ // that here.
setcursor();
out_flush_cursor(FALSE, FALSE);