aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/arglist.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-02-11 10:24:46 +0100
committerGitHub <noreply@github.com>2023-02-11 10:24:46 +0100
commitc8c930ea785aa393ebc819139913a9e05f0ccd45 (patch)
tree7ec328fa4a13dbac9a71361e6036c4d1952f9c10 /src/nvim/arglist.c
parentc9b0fe1f41ebaa6815a69ac614a5b2d1bab6f720 (diff)
downloadrneovim-c8c930ea785aa393ebc819139913a9e05f0ccd45.tar.gz
rneovim-c8c930ea785aa393ebc819139913a9e05f0ccd45.tar.bz2
rneovim-c8c930ea785aa393ebc819139913a9e05f0ccd45.zip
refactor: reduce scope of locals as per the style guide (#22206)
Diffstat (limited to 'src/nvim/arglist.c')
-rw-r--r--src/nvim/arglist.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c
index c6a4be7e13..3882b98c2c 100644
--- a/src/nvim/arglist.c
+++ b/src/nvim/arglist.c
@@ -619,8 +619,6 @@ void ex_argument(exarg_T *eap)
/// Edit file "argn" of the argument lists.
void do_argfile(exarg_T *eap, int argn)
{
- int other;
- char *p;
int old_arg_idx = curwin->w_arg_idx;
if (argn < 0 || argn >= ARGCOUNT) {
@@ -646,9 +644,9 @@ void do_argfile(exarg_T *eap, int argn)
} else {
// if 'hidden' set, only check for changed file when re-editing
// the same buffer
- other = true;
+ int other = true;
if (buf_hide(curbuf)) {
- p = fix_fname(alist_name(&ARGLIST[argn]));
+ char *p = fix_fname(alist_name(&ARGLIST[argn]));
other = otherfile(p);
xfree(p);
}
@@ -683,8 +681,6 @@ void do_argfile(exarg_T *eap, int argn)
/// ":next", and commands that behave like it.
void ex_next(exarg_T *eap)
{
- int i;
-
// check for changed buffer now, if this fails the argument list is not
// redefined.
if (buf_hide(curbuf)
@@ -692,6 +688,7 @@ void ex_next(exarg_T *eap)
|| !check_changed(curbuf, CCGD_AW
| (eap->forceit ? CCGD_FORCEIT : 0)
| CCGD_EXCMD)) {
+ int i;
if (*eap->arg != NUL) { // redefine file list
if (do_arglist(eap->arg, AL_SET, 0, true) == FAIL) {
return;