0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1115: code is indented more than needed

Problem:    Code is indented more than needed.
Solution:   Use an early return to reduce indenting. (Yegappan Lakshmanan,
            closes #11758)
This commit is contained in:
Yegappan Lakshmanan
2022-12-30 18:07:46 +00:00
committed by Bram Moolenaar
parent ef91ae4557
commit ed0c1d5d4b
5 changed files with 379 additions and 358 deletions

View File

@@ -368,36 +368,36 @@ finish_incsearch_highlighting(
incsearch_state_T *is_state,
int call_update_screen)
{
if (is_state->did_incsearch)
if (!is_state->did_incsearch)
return;
is_state->did_incsearch = FALSE;
if (gotesc)
curwin->w_cursor = is_state->save_cursor;
else
{
is_state->did_incsearch = FALSE;
if (gotesc)
curwin->w_cursor = is_state->save_cursor;
else
if (!EQUAL_POS(is_state->save_cursor, is_state->search_start))
{
if (!EQUAL_POS(is_state->save_cursor, is_state->search_start))
{
// put the '" mark at the original position
curwin->w_cursor = is_state->save_cursor;
setpcmark();
}
curwin->w_cursor = is_state->search_start;
// put the '" mark at the original position
curwin->w_cursor = is_state->save_cursor;
setpcmark();
}
restore_viewstate(&is_state->old_viewstate);
highlight_match = FALSE;
// by default search all lines
search_first_line = 0;
search_last_line = MAXLNUM;
magic_overruled = is_state->magic_overruled_save;
validate_cursor(); // needed for TAB
status_redraw_all();
redraw_all_later(UPD_SOME_VALID);
if (call_update_screen)
update_screen(UPD_SOME_VALID);
curwin->w_cursor = is_state->search_start;
}
restore_viewstate(&is_state->old_viewstate);
highlight_match = FALSE;
// by default search all lines
search_first_line = 0;
search_last_line = MAXLNUM;
magic_overruled = is_state->magic_overruled_save;
validate_cursor(); // needed for TAB
status_redraw_all();
redraw_all_later(UPD_SOME_VALID);
if (call_update_screen)
update_screen(UPD_SOME_VALID);
}
/*
@@ -4032,13 +4032,13 @@ escape_fname(char_u **pp)
char_u *p;
p = alloc(STRLEN(*pp) + 2);
if (p != NULL)
{
p[0] = '\\';
STRCPY(p + 1, *pp);
vim_free(*pp);
*pp = p;
}
if (p == NULL)
return;
p[0] = '\\';
STRCPY(p + 1, *pp);
vim_free(*pp);
*pp = p;
}
/*