diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-06-08 00:23:48 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-06-08 00:23:48 -0400 |
commit | 7e74ba4108240bd20f4ee7116c407def0d9f4458 (patch) | |
tree | 843ac76d6cf8235e7ecaf0dfa3b0fcafcad56e7d /src/nvim/ex_docmd.c | |
parent | 00fc216e2be1f3a32fd31fb08a2ecdc66acd0543 (diff) | |
parent | 24a329b53aa3be03ed79768cca04d63d6bb93891 (diff) | |
download | rneovim-7e74ba4108240bd20f4ee7116c407def0d9f4458.tar.gz rneovim-7e74ba4108240bd20f4ee7116c407def0d9f4458.tar.bz2 rneovim-7e74ba4108240bd20f4ee7116c407def0d9f4458.zip |
Merge pull request #4804 from brcolow/vim-7.4.1150
vim-patch:7.4.{1150,1151}
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index dea52ee112..3f28435ec0 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7858,19 +7858,24 @@ static void ex_stopinsert(exarg_T *eap) */ void exec_normal_cmd(char_u *cmd, int remap, bool silent) { + // Stuff the argument into the typeahead buffer. + ins_typebuf(cmd, remap, 0, true, silent); + exec_normal(false); +} + +/// Execute normal_cmd() until there is no typeahead left. +/// +/// @param was_typed whether or not something was typed +void exec_normal(bool was_typed) +{ oparg_T oa; - /* - * Stuff the argument into the typeahead buffer. - * Execute normal_cmd() until there is no typeahead left. - */ clear_oparg(&oa); - finish_op = FALSE; - ins_typebuf(cmd, remap, 0, TRUE, silent); - while ((!stuff_empty() || (!typebuf_typed() && typebuf.tb_len > 0)) - && !got_int) { + finish_op = false; + while ((!stuff_empty() || ((was_typed || !typebuf_typed()) + && typebuf.tb_len > 0)) && !got_int) { update_topline_cursor(); - normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */ + normal_cmd(&oa, true); // execute a Normal mode cmd } } |