aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2019-12-15 21:17:16 -0500
committerJames McCoy <jamessan@jamessan.com>2019-12-15 21:17:16 -0500
commit6566251d144d2c9c9e08e05c8c3a3fe9915a19b8 (patch)
tree980fd0c7287e295c8ac72858b0794f72224415e0 /src/nvim/getchar.c
parent9c4223215f71e1212462ada4e698be1b31437dd9 (diff)
parent9f3d483c79f03c48239fdc82cc02e8685a03d22a (diff)
downloadrneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.tar.gz
rneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.tar.bz2
rneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.zip
Merge remote-tracking branch 'upstream/master' into libcall
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 2469bb5baa..c038977127 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1165,12 +1165,12 @@ void free_typebuf(void)
if (typebuf.tb_buf == typebuf_init) {
internal_error("Free typebuf 1");
} else {
- xfree(typebuf.tb_buf);
+ XFREE_CLEAR(typebuf.tb_buf);
}
if (typebuf.tb_noremap == noremapbuf_init) {
internal_error("Free typebuf 2");
} else {
- xfree(typebuf.tb_noremap);
+ XFREE_CLEAR(typebuf.tb_noremap);
}
}
@@ -1833,13 +1833,13 @@ static int vgetorpeek(int advance)
char_u *p1 = mp->m_keys;
char_u *p2 = (char_u *)mb_unescape((const char **)&p1);
- if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
+ if (p2 != NULL && MB_BYTE2LEN(c1) > utfc_ptr2len(p2)) {
mlen = 0;
- /*
- * Check an entry whether it matches.
- * - Full match: mlen == keylen
- * - Partly match: mlen == typebuf.tb_len
- */
+ }
+
+ // Check an entry whether it matches.
+ // - Full match: mlen == keylen
+ // - Partly match: mlen == typebuf.tb_len
keylen = mp->m_keylen;
if (mlen == keylen
|| (mlen == typebuf.tb_len
@@ -2409,7 +2409,6 @@ int inchar(
did_outofmem_msg = FALSE; /* display out of memory message (again) */
did_swapwrite_msg = FALSE; /* display swap file write error again */
}
- undo_off = FALSE; /* restart undo now */
// Get a character from a script file if there is one.
// If interrupted: Stop reading script files, close them all.
@@ -4419,7 +4418,7 @@ mapblock_T *get_maphash(int index, buf_T *buf)
}
/// Get command argument for <Cmd> key
-char_u * getcmdkeycmd(int promptc, void *cookie, int indent)
+char_u * getcmdkeycmd(int promptc, void *cookie, int indent, bool do_concat)
{
garray_T line_ga;
int c1 = -1, c2;