mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
perf: Disable clipboard in do_cmdline().
For any script--not just `:global` commands--there is no reason to update the system clipboard until the script is finished, so disable it during do_cmdline(). Before this change, 'clipboard=unnamedplus' causes scripted editing to be extremely slow (e.g. `:normal` in a while-loop). Closes #3534
This commit is contained in:
parent
c79bf4ec99
commit
c826ebd3de
@ -4053,9 +4053,7 @@ void ex_global(exarg_T *eap)
|
|||||||
smsg(_("Pattern not found: %s"), pat);
|
smsg(_("Pattern not found: %s"), pat);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
start_batch_changes();
|
|
||||||
global_exe(cmd);
|
global_exe(cmd);
|
||||||
end_batch_changes();
|
|
||||||
}
|
}
|
||||||
ml_clearmarked(); /* clear rest of the marks */
|
ml_clearmarked(); /* clear rest of the marks */
|
||||||
vim_regfree(regmatch.regprog);
|
vim_regfree(regmatch.regprog);
|
||||||
|
@ -1983,8 +1983,6 @@ void ex_listdo(exarg_T *eap)
|
|||||||
save_ei = au_event_disable(",Syntax");
|
save_ei = au_event_disable(",Syntax");
|
||||||
}
|
}
|
||||||
|
|
||||||
start_batch_changes();
|
|
||||||
|
|
||||||
if (eap->cmdidx == CMD_windo
|
if (eap->cmdidx == CMD_windo
|
||||||
|| eap->cmdidx == CMD_tabdo
|
|| eap->cmdidx == CMD_tabdo
|
||||||
|| P_HID(curbuf)
|
|| P_HID(curbuf)
|
||||||
@ -2181,7 +2179,6 @@ void ex_listdo(exarg_T *eap)
|
|||||||
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
|
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
|
||||||
curbuf->b_fname, true, curbuf);
|
curbuf->b_fname, true, curbuf);
|
||||||
}
|
}
|
||||||
end_batch_changes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add files[count] to the arglist of the current window after arg "after".
|
/// Add files[count] to the arglist of the current window after arg "after".
|
||||||
|
@ -346,6 +346,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
++call_depth;
|
++call_depth;
|
||||||
|
start_batch_changes();
|
||||||
|
|
||||||
cstack.cs_idx = -1;
|
cstack.cs_idx = -1;
|
||||||
cstack.cs_looplevel = 0;
|
cstack.cs_looplevel = 0;
|
||||||
@ -953,6 +954,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
|
|||||||
did_endif = FALSE; /* in case do_cmdline used recursively */
|
did_endif = FALSE; /* in case do_cmdline used recursively */
|
||||||
|
|
||||||
--call_depth;
|
--call_depth;
|
||||||
|
end_batch_changes();
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9513,8 +9515,6 @@ static void ex_folddo(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
|
|
||||||
start_batch_changes();
|
|
||||||
|
|
||||||
/* First set the marks for all lines closed/open. */
|
/* First set the marks for all lines closed/open. */
|
||||||
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
|
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
|
||||||
if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
|
if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
|
||||||
@ -9523,8 +9523,6 @@ static void ex_folddo(exarg_T *eap)
|
|||||||
/* Execute the command on the marked lines. */
|
/* Execute the command on the marked lines. */
|
||||||
global_exe(eap->arg);
|
global_exe(eap->arg);
|
||||||
ml_clearmarked(); /* clear rest of the marks */
|
ml_clearmarked(); /* clear rest of the marks */
|
||||||
|
|
||||||
end_batch_changes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ex_terminal(exarg_T *eap)
|
static void ex_terminal(exarg_T *eap)
|
||||||
|
Loading…
Reference in New Issue
Block a user