aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keycodes.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-12-20 17:22:19 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-12-24 12:36:59 +0100
commitab2aad509d6e4fc57a6afe056275405ec6451671 (patch)
tree36c34cbd5d5cd1224ec4497baaf48e0835ceb0a6 /src/nvim/keycodes.c
parent84f6216130b6b6bffc97e0e221a92ccfa34e381e (diff)
downloadrneovim-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.c6
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) {