diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-02 16:54:53 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-02 16:54:53 +0000 |
commit | dc4daa3a3915fba11ac87d27977240d9a5e0d47d (patch) | |
tree | 7c28de30cdf3c6a351bd41795612be078f451c9f /src/arglist.c | |
parent | a2942c74683be3f67c6044c2886dc6c237358b3d (diff) |
patch 9.0.1132: code is indented more than neededv9.0.1132
Problem: Code is indented more than needed.
Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan,
closes #11769)
Diffstat (limited to 'src/arglist.c')
-rw-r--r-- | src/arglist.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/arglist.c b/src/arglist.c index 6183fafff6..bb31c45e93 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -693,56 +693,56 @@ do_argfile(exarg_T *eap, int argn) emsg(_(e_cannot_go_before_first_file)); else emsg(_(e_cannot_go_beyond_last_file)); + + return; } - else - { - setpcmark(); + + setpcmark(); #ifdef FEAT_GUI - need_mouse_correct = TRUE; + need_mouse_correct = TRUE; #endif - // split window or create new tab page first - if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) - { - if (win_split(0, 0) == FAIL) - return; - RESET_BINDING(curwin); - } - else + // split window or create new tab page first + if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) + { + if (win_split(0, 0) == FAIL) + return; + RESET_BINDING(curwin); + } + else + { + // if 'hidden' set, only check for changed file when re-editing + // the same buffer + other = TRUE; + if (buf_hide(curbuf)) { - // if 'hidden' set, only check for changed file when re-editing - // the same buffer - other = TRUE; - if (buf_hide(curbuf)) - { - p = fix_fname(alist_name(&ARGLIST[argn])); - other = otherfile(p); - vim_free(p); - } - if ((!buf_hide(curbuf) || !other) - && check_changed(curbuf, CCGD_AW - | (other ? 0 : CCGD_MULTWIN) - | (eap->forceit ? CCGD_FORCEIT : 0) - | CCGD_EXCMD)) - return; + p = fix_fname(alist_name(&ARGLIST[argn])); + other = otherfile(p); + vim_free(p); } - - curwin->w_arg_idx = argn; - if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) - arg_had_last = TRUE; - - // Edit the file; always use the last known line number. - // When it fails (e.g. Abort for already edited file) restore the - // argument index. - if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, - eap, ECMD_LAST, - (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) - + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) - curwin->w_arg_idx = old_arg_idx; - // like Vi: set the mark where the cursor is in the file. - else if (eap->cmdidx != CMD_argdo) - setmark('\''); + if ((!buf_hide(curbuf) || !other) + && check_changed(curbuf, CCGD_AW + | (other ? 0 : CCGD_MULTWIN) + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) + return; } + + curwin->w_arg_idx = argn; + if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) + arg_had_last = TRUE; + + // Edit the file; always use the last known line number. + // When it fails (e.g. Abort for already edited file) restore the + // argument index. + if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, + eap, ECMD_LAST, + (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) + + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) + curwin->w_arg_idx = old_arg_idx; + // like Vi: set the mark where the cursor is in the file. + else if (eap->cmdidx != CMD_argdo) + setmark('\''); } /* |