aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-10-09 21:17:15 +0800
committerckelsel <ckelsel@hotmail.com>2017-10-09 21:17:15 +0800
commit2abd939daeb550e745ba3e6572fae24aff105ef9 (patch)
tree9850ffe239203a5b980ef16a41e2dd9669b0f2a1 /src/nvim/getchar.c
parent5d369ad3843bbc0a3541827284f55430ec4f46e4 (diff)
parentceb40c0411843b35005f019bf2c61f22572afcdf (diff)
downloadrneovim-2abd939daeb550e745ba3e6572fae24aff105ef9.tar.gz
rneovim-2abd939daeb550e745ba3e6572fae24aff105ef9.tar.bz2
rneovim-2abd939daeb550e745ba3e6572fae24aff105ef9.zip
Merge branch 'master' of github.com:ckelsel/neovim into vim-8.0.0101
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index f5949333bd..4f8a8528a0 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -868,20 +868,15 @@ int ins_typebuf(char_u *str, int noremap, int offset, int nottyped, bool silent)
addlen = (int)STRLEN(str);
- /*
- * Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
- */
if (offset == 0 && addlen <= typebuf.tb_off) {
+ // Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
typebuf.tb_off -= addlen;
memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
- }
- /*
- * Need to allocate a new buffer.
- * In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
- * characters. We add some extra room to avoid having to allocate too
- * often.
- */
- else {
+ } else {
+ // Need to allocate a new buffer.
+ // In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
+ // characters. We add some extra room to avoid having to allocate too
+ // often.
newoff = MAXMAPLEN + 4;
newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
if (newlen < 0) { /* string is getting too long */
@@ -1663,10 +1658,10 @@ static int vgetorpeek(int advance)
}
if (c != NUL && !got_int) {
if (advance) {
- /* KeyTyped = FALSE; When the command that stuffed something
- * was typed, behave like the stuffed command was typed.
- * needed for CTRL-W CTRl-] to open a fold, for example. */
- KeyStuffed = TRUE;
+ // KeyTyped = FALSE; When the command that stuffed something
+ // was typed, behave like the stuffed command was typed.
+ // needed for CTRL-W CTRL-] to open a fold, for example.
+ KeyStuffed = true;
}
if (typebuf.tb_no_abbr_cnt == 0)
typebuf.tb_no_abbr_cnt = 1; /* no abbreviations now */