diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-02-11 14:14:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 14:14:24 +0100 |
commit | 27177e581902967dcf4f2f426464da1b636ca420 (patch) | |
tree | ba52f1e21ad2c4d4a00dc4af9fa602ae27bb86df /src/nvim/input.c | |
parent | 224a3c77caa6fea8299eb3be326fa6ff7300a21b (diff) | |
download | rneovim-27177e581902967dcf4f2f426464da1b636ca420.tar.gz rneovim-27177e581902967dcf4f2f426464da1b636ca420.tar.bz2 rneovim-27177e581902967dcf4f2f426464da1b636ca420.zip |
refactor: reduce scope of locals as per the style guide (#22211)
Diffstat (limited to 'src/nvim/input.c')
-rw-r--r-- | src/nvim/input.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/input.c b/src/nvim/input.c index 2869155a09..5b9b866778 100644 --- a/src/nvim/input.c +++ b/src/nvim/input.c @@ -88,7 +88,6 @@ int get_keystroke(MultiQueue *events) { char *buf = NULL; int buflen = 150; - int maxlen; int len = 0; int n; int save_mapped_ctrl_c = mapped_ctrl_c; @@ -100,7 +99,7 @@ int get_keystroke(MultiQueue *events) // Leave some room for check_termcode() to insert a key code into (max // 5 chars plus NUL). And fix_input_buffer() can triple the number of // bytes. - maxlen = (buflen - 6 - len) / 3; + int maxlen = (buflen - 6 - len) / 3; if (buf == NULL) { buf = xmalloc((size_t)buflen); } else if (maxlen < 10) { @@ -166,7 +165,6 @@ int get_keystroke(MultiQueue *events) int get_number(int colon, int *mouse_used) { int n = 0; - int c; int typed = 0; if (mouse_used != NULL) { @@ -183,7 +181,7 @@ int get_number(int colon, int *mouse_used) allow_keys++; // no mapping here, but recognize keys for (;;) { ui_cursor_goto(msg_row, msg_col); - c = safe_vgetc(); + int c = safe_vgetc(); if (ascii_isdigit(c)) { n = n * 10 + c - '0'; msg_putchar(c); |