diff options
author | dundargoc <gocdundar@gmail.com> | 2023-12-20 17:22:19 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-24 12:36:59 +0100 |
commit | ab2aad509d6e4fc57a6afe056275405ec6451671 (patch) | |
tree | 36c34cbd5d5cd1224ec4497baaf48e0835ceb0a6 /src/nvim/keycodes.c | |
parent | 84f6216130b6b6bffc97e0e221a92ccfa34e381e (diff) | |
download | rneovim-ab2aad509d6e4fc57a6afe056275405ec6451671.tar.gz rneovim-ab2aad509d6e4fc57a6afe056275405ec6451671.tar.bz2 rneovim-ab2aad509d6e4fc57a6afe056275405ec6451671.zip |
refactor: follow style guide
Diffstat (limited to 'src/nvim/keycodes.c')
-rw-r--r-- | src/nvim/keycodes.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c index d913beeb0c..dd7a917380 100644 --- a/src/nvim/keycodes.c +++ b/src/nvim/keycodes.c @@ -875,9 +875,7 @@ char *replace_termcodes(const char *const from, const size_t from_len, char **co const char *const cpo_val) FUNC_ATTR_NONNULL_ARG(1, 3, 7) { - char key; size_t dlen = 0; - const char *src; const char *const end = from + from_len - 1; // backslash is a special character @@ -891,7 +889,7 @@ char *replace_termcodes(const char *const from, const size_t from_len, char **co const size_t buf_len = allocated ? from_len * 6 + 1 : 128; char *result = allocated ? xmalloc(buf_len) : *bufp; // buffer for resulting string - src = from; + const char *src = from; // Copy each byte from *from to result[dlen] while (src <= end) { @@ -966,7 +964,7 @@ char *replace_termcodes(const char *const from, const size_t from_len, char **co // For "from" side the CTRL-V at the end is included, for the "to" // part it is removed. // If 'cpoptions' does not contain 'B', also accept a backslash. - key = *src; + char key = *src; if (key == Ctrl_V || (do_backslash && key == '\\')) { src++; // skip CTRL-V or backslash if (src > end) { |