aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/main.c10
-rw-r--r--src/nvim/mbyte.c28
-rw-r--r--src/nvim/memline.c24
-rw-r--r--src/nvim/menu.c28
4 files changed, 45 insertions, 45 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 00a43c9c79..4b4ab687b2 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1461,9 +1461,9 @@ static void create_windows(mparm_T *parmp)
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;
@@ -1553,8 +1553,8 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
// 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,
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 62cc3b56ed..bd680330ca 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -675,16 +675,16 @@ static int utf_safe_read_char_adv(const char_u **s, size_t *n)
}
if (k <= *n) {
- /* We have a multibyte sequence and it isn't truncated by buffer
- * limits so utf_ptr2char() is safe to use. Or the first byte is
- * illegal (k=0), and it's also safe to use utf_ptr2char(). */
+ // We have a multibyte sequence and it isn't truncated by buffer
+ // limits so utf_ptr2char() is safe to use. Or the first byte is
+ // illegal (k=0), and it's also safe to use utf_ptr2char().
c = utf_ptr2char(*s);
- /* On failure, utf_ptr2char() returns the first byte, so here we
- * check equality with the first byte. The only non-ASCII character
- * which equals the first byte of its own UTF-8 representation is
- * U+00C3 (UTF-8: 0xC3 0x83), so need to check that special case too.
- * It's safe even if n=1, else we would have k=2 > n. */
+ // On failure, utf_ptr2char() returns the first byte, so here we
+ // check equality with the first byte. The only non-ASCII character
+ // which equals the first byte of its own UTF-8 representation is
+ // U+00C3 (UTF-8: 0xC3 0x83), so need to check that special case too.
+ // It's safe even if n=1, else we would have k=2 > n.
if (c != (int)(**s) || (c == 0xC3 && (*s)[1] == 0x83)) {
// byte sequence was successfully decoded
*s += k;
@@ -1582,8 +1582,8 @@ void show_utf8(void)
int clen;
int i;
- /* Get the byte length of the char under the cursor, including composing
- * characters. */
+ // Get the byte length of the char under the cursor, including composing
+ // characters.
line = get_cursor_pos_ptr();
len = utfc_ptr2len(line);
if (len == 0) {
@@ -1625,8 +1625,8 @@ int utf_head_off(const char_u *base, const char_u *p)
return 0;
}
- /* Skip backwards over trailing bytes: 10xx.xxxx
- * Skip backwards again if on a composing char. */
+ // Skip backwards over trailing bytes: 10xx.xxxx
+ // Skip backwards again if on a composing char.
const char_u *q;
for (q = p;; --q) {
// Move s to the last byte of this char.
@@ -1915,8 +1915,8 @@ void utf_find_illegal(void)
}
while (*p != NUL) {
- /* Illegal means that there are not enough trail bytes (checked by
- * utf_ptr2len()) or too many of them (overlong sequence). */
+ // Illegal means that there are not enough trail bytes (checked by
+ // utf_ptr2len()) or too many of them (overlong sequence).
len = utf_ptr2len(p);
if (*p >= 0x80 && (len == 1
|| utf_char2len(utf_ptr2char(p)) != len)) {
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 29e4a03d51..b4e9869b17 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -106,8 +106,8 @@ struct pointer_block {
uint16_t pb_id; // ID for pointer block: PTR_ID
uint16_t pb_count; // number of pointers in this block
uint16_t pb_count_max; // maximum value for pb_count
- PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer)
- * followed by empty space until end of page */
+ PTR_EN pb_pointer[1]; // list of pointers to blocks (actually longer)
+ // followed by empty space until end of page
};
/*
@@ -1333,8 +1333,8 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
if (dir_name[0] == '.' && dir_name[1] == NUL) { // check current dir
if (fname == NULL) {
names[0] = vim_strsave((char_u *)"*.sw?");
- /* For Unix names starting with a dot are special. MS-Windows
- * supports this too, on some file systems. */
+ // For Unix names starting with a dot are special. MS-Windows
+ // supports this too, on some file systems.
names[1] = vim_strsave((char_u *)".*.sw?");
names[2] = vim_strsave((char_u *)".sw?");
num_names = 3;
@@ -1343,11 +1343,11 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
}
} else { // check directory dir_name
if (fname == NULL) {
- names[0] = (char_u *)concat_fnames((char *)dir_name, "*.sw?", TRUE);
- /* For Unix names starting with a dot are special. MS-Windows
- * supports this too, on some file systems. */
- names[1] = (char_u *)concat_fnames((char *)dir_name, ".*.sw?", TRUE);
- names[2] = (char_u *)concat_fnames((char *)dir_name, ".sw?", TRUE);
+ names[0] = (char_u *)concat_fnames((char *)dir_name, "*.sw?", true);
+ // For Unix names starting with a dot are special. MS-Windows
+ // supports this too, on some file systems.
+ names[1] = (char_u *)concat_fnames((char *)dir_name, ".*.sw?", true);
+ names[2] = (char_u *)concat_fnames((char *)dir_name, ".sw?", true);
num_names = 3;
} else {
int len = (int)STRLEN(dir_name);
@@ -3377,8 +3377,8 @@ static void attention_message(buf_T *buf, char_u *fname)
MSG_PUTS(_(" NEWER than swap file!\n"));
}
}
- /* Some of these messages are long to allow translation to
- * other languages. */
+ // Some of these messages are long to allow translation to
+ // other languages.
MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is"
" the case,\n be careful not to end up with two different"
" instances of the same\n file when making changes."
@@ -3551,7 +3551,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, bool *found_
}
// give the ATTENTION message when there is an old swap file
- // for the current file, and the buffer was not recovered. */
+ // for the current file, and the buffer was not recovered.
if (differ == false && !(curbuf->b_flags & BF_RECOVERED)
&& vim_strchr(p_shm, SHM_ATTENTION) == NULL) {
int choice = 0;
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 2250002f86..f1ae8740bb 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -305,8 +305,8 @@ static int add_menu_path(const char_u *const menu_path, vimmenu_T *menuarg,
parent = NULL;
name = path_name;
while (*name) {
- /* Get name of this element in the menu hierarchy, and the simplified
- * name (without mnemonic and accelerator text). */
+ // Get name of this element in the menu hierarchy, and the simplified
+ // name (without mnemonic and accelerator text).
next_name = menu_name_skip(name);
map_to = menutrans_lookup(name, (int)STRLEN(name));
if (map_to != NULL) {
@@ -481,8 +481,8 @@ erret:
xfree(path_name);
xfree(dname);
- /* Delete any empty submenu we added before discovering the error. Repeat
- * for higher levels. */
+ // Delete any empty submenu we added before discovering the error. Repeat
+ // for higher levels.
while (parent != NULL && parent->children == NULL) {
if (parent->parent == NULL) {
menup = root_menu_ptr;
@@ -650,8 +650,8 @@ static void free_menu(vimmenu_T **menup)
menu = *menup;
- /* Don't change *menup until after calling gui_mch_destroy_menu(). The
- * MacOS code needs the original structure to properly delete the menu. */
+ // Don't change *menup until after calling gui_mch_destroy_menu(). The
+ // MacOS code needs the original structure to properly delete the menu.
*menup = menu->next;
xfree(menu->name);
xfree(menu->dname);
@@ -1122,8 +1122,8 @@ char_u *get_menu_names(expand_T *xp, int idx)
should_advance = true;
}
}
- /* hack on menu separators: use a 'magic' char for the separator
- * so that '.' in names gets escaped properly */
+ // hack on menu separators: use a 'magic' char for the separator
+ // so that '.' in names gets escaped properly
STRCAT(tbuffer, "\001");
str = tbuffer;
} else {
@@ -1404,10 +1404,10 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
mode = "Visual";
idx = MENU_INDEX_VISUAL;
- /* GEDDES: This is not perfect - but it is a
- * quick way of detecting whether we are doing this from a
- * selection - see if the range matches up with the visual
- * select start and end. */
+ // GEDDES: This is not perfect - but it is a
+ // quick way of detecting whether we are doing this from a
+ // selection - see if the range matches up with the visual
+ // select start and end.
if ((curbuf->b_visual.vi_start.lnum == eap->line1)
&& (curbuf->b_visual.vi_end.lnum) == eap->line2) {
// Set it up for visual mode - equivalent to gv.
@@ -1434,8 +1434,8 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
check_cursor();
- /* Adjust the cursor to make sure it is in the correct pos
- * for exclusive mode */
+ // Adjust the cursor to make sure it is in the correct pos
+ // for exclusive mode
if (*p_sel == 'e' && gchar_cursor() != NUL) {
curwin->w_cursor.col++;
}