diff options
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 62 |
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; } /* |