diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-08-25 20:47:00 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-08-25 20:47:00 -0400 |
commit | 4af6ec746c821078859469adc46cf7bef5c629fa (patch) | |
tree | 5965ab1fc3cd3d96954136655946672be412eb75 /src/nvim/ex_docmd.c | |
parent | 41a64586c7d16bd8bdec533717daeea3fa2f3107 (diff) | |
parent | 7a589e4a9e4a8dffc173bcb3a53286961032b2de (diff) | |
download | rneovim-4af6ec746c821078859469adc46cf7bef5c629fa.tar.gz rneovim-4af6ec746c821078859469adc46cf7bef5c629fa.tar.bz2 rneovim-4af6ec746c821078859469adc46cf7bef5c629fa.zip |
Merge #5253 'perf: Disable clipboard in do_cmdline()'
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1e54f03ba0..2960a0569a 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -345,7 +345,8 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, msg_list = saved_msg_list; return FAIL; } - ++call_depth; + call_depth++; + start_batch_changes(); cstack.cs_idx = -1; cstack.cs_looplevel = 0; @@ -952,7 +953,8 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, did_endif = FALSE; /* in case do_cmdline used recursively */ - --call_depth; + call_depth--; + end_batch_changes(); return retval; } @@ -9511,20 +9513,15 @@ static void ex_foldopen(exarg_T *eap) static void ex_folddo(exarg_T *eap) { - linenr_T lnum; - - start_global_changes(); - - /* First set the marks for all lines closed/open. */ - for (lnum = eap->line1; lnum <= eap->line2; ++lnum) - if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) + // First set the marks for all lines closed/open. + for (linenr_T lnum = eap->line1; lnum <= eap->line2; ++lnum) { + if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) { ml_setmarked(lnum); + } + } - /* Execute the command on the marked lines. */ - global_exe(eap->arg); - ml_clearmarked(); /* clear rest of the marks */ - - end_global_changes(); + global_exe(eap->arg); // Execute the command on the marked lines. + ml_clearmarked(); // clear rest of the marks } static void ex_terminal(exarg_T *eap) |