mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
vim-patch:partial:9.0.1166: code is indented more than necessary (#21716)
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11792)1cfb14aa97
Partial port as some highlight.c changes depend on previous patches. Cherry-pick fname_match() change from patch 8.2.4959. Omit internal_func_check_arg_types(): only used for Vim9 script. N/A patches for version.c: vim-patch:9.0.1167: EditorConfig files do not have their own filetype Problem: EditorConfig files do not have their own filetype. Solution: Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779)d41262ed06
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -317,13 +317,15 @@ static int get_maxbacktrace_level(char *sname)
|
||||
{
|
||||
int maxbacktrace = 0;
|
||||
|
||||
if (sname != NULL) {
|
||||
char *p = sname;
|
||||
char *q;
|
||||
while ((q = strstr(p, "..")) != NULL) {
|
||||
p = q + 2;
|
||||
maxbacktrace++;
|
||||
}
|
||||
if (sname == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *p = sname;
|
||||
char *q;
|
||||
while ((q = strstr(p, "..")) != NULL) {
|
||||
p = q + 2;
|
||||
maxbacktrace++;
|
||||
}
|
||||
return maxbacktrace;
|
||||
}
|
||||
@@ -458,20 +460,21 @@ void dbg_check_breakpoint(exarg_T *eap)
|
||||
/// @return true when the debug mode is entered this time.
|
||||
bool dbg_check_skipped(exarg_T *eap)
|
||||
{
|
||||
if (debug_skipped) {
|
||||
// Save the value of got_int and reset it. We don't want a previous
|
||||
// interruption cause flushing the input buffer.
|
||||
int prev_got_int = got_int;
|
||||
got_int = false;
|
||||
debug_breakpoint_name = debug_skipped_name;
|
||||
// eap->skip is true
|
||||
eap->skip = false;
|
||||
dbg_check_breakpoint(eap);
|
||||
eap->skip = true;
|
||||
got_int |= prev_got_int;
|
||||
return true;
|
||||
if (!debug_skipped) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
// Save the value of got_int and reset it. We don't want a previous
|
||||
// interruption cause flushing the input buffer.
|
||||
int prev_got_int = got_int;
|
||||
got_int = false;
|
||||
debug_breakpoint_name = debug_skipped_name;
|
||||
// eap->skip is true
|
||||
eap->skip = false;
|
||||
dbg_check_breakpoint(eap);
|
||||
eap->skip = true;
|
||||
got_int |= prev_got_int;
|
||||
return true;
|
||||
}
|
||||
|
||||
static garray_T dbg_breakp = { 0, 0, sizeof(struct debuggy), 4, NULL };
|
||||
|
Reference in New Issue
Block a user