aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c82
1 files changed, 29 insertions, 53 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 2112385533..da99a03c38 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1,9 +1,7 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-/*
- * ex_getln.c: Functions for entering and editing an Ex command line.
- */
+// ex_getln.c: Functions for entering and editing an Ex command line.
#include <assert.h>
#include <inttypes.h>
@@ -2603,10 +2601,8 @@ bool text_locked(void)
return textlock != 0;
}
-/*
- * Give an error message for a command that isn't allowed while the cmdline
- * window is open or editing the cmdline in another way.
- */
+// Give an error message for a command that isn't allowed while the cmdline
+// window is open or editing the cmdline in another way.
void text_locked_msg(void)
{
emsg(_(get_text_locked_msg()));
@@ -2738,15 +2734,11 @@ bool cmdline_at_end(void)
return (ccline.cmdpos >= ccline.cmdlen);
}
-/*
- * Allocate a new command line buffer.
- * Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen.
- */
+// Allocate a new command line buffer.
+// Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen.
static void alloc_cmdbuff(int len)
{
- /*
- * give some extra space to avoid having to allocate all the time
- */
+ // give some extra space to avoid having to allocate all the time
if (len < 80) {
len = 100;
} else {
@@ -3088,10 +3080,8 @@ color_cmdline_error:
#undef PRINT_ERRMSG
}
-/*
- * Draw part of the cmdline at the current cursor position. But draw stars
- * when cmdline_star is true.
- */
+// Draw part of the cmdline at the current cursor position. But draw stars
+// when cmdline_star is true.
static void draw_cmdline(int start, int len)
{
if (!color_cmdline(&ccline)) {
@@ -3342,11 +3332,9 @@ void cmdline_ui_flush(void)
}
}
-/*
- * Put a character on the command line. Shifts the following text to the
- * right when "shift" is true. Used for CTRL-V, CTRL-K, etc.
- * "c" must be printable (fit in one display cell)!
- */
+// Put a character on the command line. Shifts the following text to the
+// right when "shift" is true. Used for CTRL-V, CTRL-K, etc.
+// "c" must be printable (fit in one display cell)!
void putcmdline(char c, int shift)
{
if (cmd_silent) {
@@ -3388,14 +3376,12 @@ void unputcmdline(void)
ui_cursor_shape();
}
-/*
- * Put the given string, of the given length, onto the command line.
- * If len is -1, then STRLEN() is used to calculate the length.
- * If 'redraw' is true then the new part of the command line, and the remaining
- * part will be redrawn, otherwise it will not. If this function is called
- * twice in a row, then 'redraw' should be false and redrawcmd() should be
- * called afterwards.
- */
+// Put the given string, of the given length, onto the command line.
+// If len is -1, then STRLEN() is used to calculate the length.
+// If 'redraw' is true then the new part of the command line, and the remaining
+// part will be redrawn, otherwise it will not. If this function is called
+// twice in a row, then 'redraw' should be false and redrawcmd() should be
+// called afterwards.
void put_on_cmdline(char_u *str, int len, int redraw)
{
int i;
@@ -3603,12 +3589,10 @@ static bool cmdline_paste(int regname, bool literally, bool remcr)
return cmdline_paste_reg(regname, literally, remcr);
}
-/*
- * Put a string on the command line.
- * When "literally" is true, insert literally.
- * When "literally" is false, insert as typed, but don't leave the command
- * line.
- */
+// Put a string on the command line.
+// When "literally" is true, insert literally.
+// When "literally" is false, insert as typed, but don't leave the command
+// line.
void cmdline_paste_str(char_u *s, int literally)
{
int c, cv;
@@ -3675,9 +3659,7 @@ static void redrawcmdprompt(void)
}
}
-/*
- * Redraw what is currently on the command line.
- */
+// Redraw what is currently on the command line.
void redrawcmd(void)
{
if (cmd_silent) {
@@ -3714,10 +3696,8 @@ void redrawcmd(void)
putcmdline(ccline.special_char, ccline.special_shift);
}
- /*
- * An emsg() before may have set msg_scroll. This is used in normal mode,
- * in cmdline mode we can reset them now.
- */
+ // An emsg() before may have set msg_scroll. This is used in normal mode,
+ // in cmdline mode we can reset them now.
msg_scroll = false; // next message overwrites cmdline
// Typing ':' at the more prompt may set skip_redraw. We don't want this
@@ -3794,12 +3774,10 @@ void gotocmdline(bool clr)
cmd_cursor_goto(cmdline_row, 0);
}
-/*
- * Check the word in front of the cursor for an abbreviation.
- * Called when the non-id character "c" has been entered.
- * When an abbreviation is recognized it is removed from the text with
- * backspaces and the replacement string is inserted, followed by "c".
- */
+// Check the word in front of the cursor for an abbreviation.
+// Called when the non-id character "c" has been entered.
+// When an abbreviation is recognized it is removed from the text with
+// backspaces and the replacement string is inserted, followed by "c".
static int ccheck_abbr(int c)
{
int spos = 0;
@@ -4310,9 +4288,7 @@ static int open_cmdwin(void)
RedrawingDisabled = 0;
int save_count = save_batch_count();
- /*
- * Call the main loop until <CR> or CTRL-C is typed.
- */
+ // Call the main loop until <CR> or CTRL-C is typed.
normal_enter(true, false);
RedrawingDisabled = i;