aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mapping.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-12-28 13:42:24 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-12-30 12:45:38 +0100
commitc89292fcb7f2ebf06efb7c1d00c28f34c6f68fec (patch)
treeb1257a572495337ca936c47839bb08aa45528c84 /src/nvim/mapping.c
parentd634cd5b0bc3ac6bdf285432f74a1c10f12b6031 (diff)
downloadrneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.tar.gz
rneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.tar.bz2
rneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.zip
refactor: follow style guide
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r--src/nvim/mapping.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 63604352cf..58fce92fb0 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -1528,7 +1528,6 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
: (mp = mp->m_next)) {
int qlen = mp->m_keylen;
char *q = mp->m_keys;
- int match;
if (strchr(mp->m_keys, K_SPECIAL) != NULL) {
// Might have K_SPECIAL escaped mp->m_keys.
@@ -1537,9 +1536,9 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
qlen = (int)strlen(q);
}
// find entries with right mode and keys
- match = (mp->m_mode & State)
- && qlen == len
- && !strncmp(q, ptr, (size_t)len);
+ int match = (mp->m_mode & State)
+ && qlen == len
+ && !strncmp(q, ptr, (size_t)len);
if (q != mp->m_keys) {
xfree(q);
}
@@ -1587,7 +1586,7 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
}
tb[j] = NUL;
// insert the last typed char
- (void)ins_typebuf((char *)tb, 1, 0, true, mp->m_silent);
+ ins_typebuf((char *)tb, 1, 0, true, mp->m_silent);
}
// copy values here, calling eval_map_expr() may make "mp" invalid!
@@ -1603,7 +1602,7 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
}
if (s != NULL) {
// insert the to string
- (void)ins_typebuf(s, noremap, 0, true, silent);
+ ins_typebuf(s, noremap, 0, true, silent);
// no abbrev. for these chars
typebuf.tb_no_abbr_cnt += (int)strlen(s) + j + 1;
if (expr) {
@@ -1615,7 +1614,7 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
tb[1] = NUL;
len = clen; // Delete characters instead of bytes
while (len-- > 0) { // delete the from string
- (void)ins_typebuf((char *)tb, 1, 0, true, silent);
+ ins_typebuf((char *)tb, 1, 0, true, silent);
}
return true;
}
@@ -2177,8 +2176,8 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
if (did_simplify) {
// When the lhs is being simplified the not-simplified keys are
// preferred for printing, like in do_map().
- (void)replace_termcodes(keys, strlen(keys), &alt_keys_buf, 0,
- flags | REPTERM_NO_SIMPLIFY, NULL, p_cpo);
+ replace_termcodes(keys, strlen(keys), &alt_keys_buf, 0,
+ flags | REPTERM_NO_SIMPLIFY, NULL, p_cpo);
rhs = check_map(alt_keys_buf, mode, exact, false, abbr, &mp, &buffer_local, &rhs_lua);
}
@@ -2399,8 +2398,8 @@ void f_maplist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
bool did_simplify = false;
char *lhs = str2special_save(mp->m_keys, true, false);
- (void)replace_termcodes(lhs, strlen(lhs), &keys_buf, 0, flags, &did_simplify,
- p_cpo);
+ replace_termcodes(lhs, strlen(lhs), &keys_buf, 0, flags, &did_simplify,
+ p_cpo);
xfree(lhs);
Dictionary dict = mapblock_fill_dict(mp,