summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-12-30 18:07:46 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-30 18:07:46 +0000
commited0c1d5d4b30d03b26ff08841f6da2ddf44025a7 (patch)
treef30f357f2f6b1e3152cc52d038f41b7adced9840 /src/ex_getln.c
parentef91ae4557ac93e581b0ec39bf4c78c3556d7484 (diff)
patch 9.0.1115: code is indented more than neededv9.0.1115
Problem: Code is indented more than needed. Solution: Use an early return to reduce indenting. (Yegappan Lakshmanan, closes #11758)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 5614ea6a9e..4884ebd8a3 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -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;
+ 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;
+ // by default search all lines
+ search_first_line = 0;
+ search_last_line = MAXLNUM;
- magic_overruled = is_state->magic_overruled_save;
+ 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);
- }
+ 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;
}
/*