mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
*: Comment intentional fallthroughs
Falling through a switch case should be commented so it's clear that behavior is intentional.
This commit is contained in:
@@ -3607,6 +3607,7 @@ int build_stl_str_hl(
|
|||||||
|
|
||||||
case STL_OFFSET_X:
|
case STL_OFFSET_X:
|
||||||
base = kNumBaseHexadecimal;
|
base = kNumBaseHexadecimal;
|
||||||
|
// fallthrough
|
||||||
case STL_OFFSET:
|
case STL_OFFSET:
|
||||||
{
|
{
|
||||||
long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
|
long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
|
||||||
@@ -3617,6 +3618,7 @@ int build_stl_str_hl(
|
|||||||
}
|
}
|
||||||
case STL_BYTEVAL_X:
|
case STL_BYTEVAL_X:
|
||||||
base = kNumBaseHexadecimal;
|
base = kNumBaseHexadecimal;
|
||||||
|
// fallthrough
|
||||||
case STL_BYTEVAL:
|
case STL_BYTEVAL:
|
||||||
num = byteval;
|
num = byteval;
|
||||||
if (num == NL)
|
if (num == NL)
|
||||||
|
@@ -4916,13 +4916,16 @@ static unsigned quote_meta(char_u *dest, char_u *src, int len)
|
|||||||
if (ctrl_x_mode == CTRL_X_DICTIONARY
|
if (ctrl_x_mode == CTRL_X_DICTIONARY
|
||||||
|| ctrl_x_mode == CTRL_X_THESAURUS)
|
|| ctrl_x_mode == CTRL_X_THESAURUS)
|
||||||
break;
|
break;
|
||||||
|
// fallthrough
|
||||||
case '~':
|
case '~':
|
||||||
if (!p_magic) /* quote these only if magic is set */
|
if (!p_magic) /* quote these only if magic is set */
|
||||||
break;
|
break;
|
||||||
|
// fallthrough
|
||||||
case '\\':
|
case '\\':
|
||||||
if (ctrl_x_mode == CTRL_X_DICTIONARY
|
if (ctrl_x_mode == CTRL_X_DICTIONARY
|
||||||
|| ctrl_x_mode == CTRL_X_THESAURUS)
|
|| ctrl_x_mode == CTRL_X_THESAURUS)
|
||||||
break;
|
break;
|
||||||
|
// fallthrough
|
||||||
case '^': /* currently it's not needed. */
|
case '^': /* currently it's not needed. */
|
||||||
case '$':
|
case '$':
|
||||||
m++;
|
m++;
|
||||||
|
@@ -9596,13 +9596,15 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
if (from) {
|
if (from) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kCdScopeTab: // FALLTHROUGH
|
// fallthrough
|
||||||
|
case kCdScopeTab:
|
||||||
assert(tp);
|
assert(tp);
|
||||||
from = tp->tp_localdir;
|
from = tp->tp_localdir;
|
||||||
if (from) {
|
if (from) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kCdScopeGlobal: // FALLTHROUGH
|
// fallthrough
|
||||||
|
case kCdScopeGlobal:
|
||||||
if (globaldir) { // `globaldir` is not always set.
|
if (globaldir) { // `globaldir` is not always set.
|
||||||
from = globaldir;
|
from = globaldir;
|
||||||
} else if (os_dirname(cwd, MAXPATHL) == FAIL) { // Get the OS CWD.
|
} else if (os_dirname(cwd, MAXPATHL) == FAIL) { // Get the OS CWD.
|
||||||
|
@@ -1268,6 +1268,7 @@ static int command_line_handle_key(CommandLineState *s)
|
|||||||
}
|
}
|
||||||
return command_line_changed(s);
|
return command_line_changed(s);
|
||||||
}
|
}
|
||||||
|
// fallthrough
|
||||||
|
|
||||||
case K_UP:
|
case K_UP:
|
||||||
case K_DOWN:
|
case K_DOWN:
|
||||||
|
@@ -1861,6 +1861,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
|
|||||||
} else {
|
} else {
|
||||||
bangredo = true; // do_bang() will put cmd in redo buffer.
|
bangredo = true; // do_bang() will put cmd in redo buffer.
|
||||||
}
|
}
|
||||||
|
// fallthrough
|
||||||
|
|
||||||
case OP_INDENT:
|
case OP_INDENT:
|
||||||
case OP_COLON:
|
case OP_COLON:
|
||||||
|
@@ -4194,6 +4194,7 @@ skip_add:
|
|||||||
subs = addstate(l, state->out, subs, pim, off_arg);
|
subs = addstate(l, state->out, subs, pim, off_arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// fallthrough
|
||||||
case NFA_MCLOSE1:
|
case NFA_MCLOSE1:
|
||||||
case NFA_MCLOSE2:
|
case NFA_MCLOSE2:
|
||||||
case NFA_MCLOSE3:
|
case NFA_MCLOSE3:
|
||||||
|
Reference in New Issue
Block a user