mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
ops.c: Rename start_global_changes().
This commit is contained in:
@@ -4053,9 +4053,9 @@ void ex_global(exarg_T *eap)
|
|||||||
smsg(_("Pattern not found: %s"), pat);
|
smsg(_("Pattern not found: %s"), pat);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
start_global_changes();
|
start_batch_changes();
|
||||||
global_exe(cmd);
|
global_exe(cmd);
|
||||||
end_global_changes();
|
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,7 +1983,7 @@ void ex_listdo(exarg_T *eap)
|
|||||||
save_ei = au_event_disable(",Syntax");
|
save_ei = au_event_disable(",Syntax");
|
||||||
}
|
}
|
||||||
|
|
||||||
start_global_changes();
|
start_batch_changes();
|
||||||
|
|
||||||
if (eap->cmdidx == CMD_windo
|
if (eap->cmdidx == CMD_windo
|
||||||
|| eap->cmdidx == CMD_tabdo
|
|| eap->cmdidx == CMD_tabdo
|
||||||
@@ -2181,7 +2181,7 @@ 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_global_changes();
|
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".
|
||||||
|
@@ -9513,7 +9513,7 @@ static void ex_folddo(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
|
|
||||||
start_global_changes();
|
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)
|
||||||
@@ -9524,7 +9524,7 @@ static void ex_folddo(exarg_T *eap)
|
|||||||
global_exe(eap->arg);
|
global_exe(eap->arg);
|
||||||
ml_clearmarked(); /* clear rest of the marks */
|
ml_clearmarked(); /* clear rest of the marks */
|
||||||
|
|
||||||
end_global_changes();
|
end_batch_changes();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ex_terminal(exarg_T *eap)
|
static void ex_terminal(exarg_T *eap)
|
||||||
|
@@ -51,10 +51,10 @@ static yankreg_T *y_previous = NULL; /* ptr to last written yankreg */
|
|||||||
|
|
||||||
static bool clipboard_didwarn_unnamed = false;
|
static bool clipboard_didwarn_unnamed = false;
|
||||||
|
|
||||||
// for behavior between start_global_changes() and end_global_changes())
|
// for behavior between start_batch_changes() and end_batch_changes())
|
||||||
static bool clipboard_delay_update = false; // delay clipboard update
|
static bool clipboard_delay_update = false; // delay clipboard update
|
||||||
static int global_change_count = 0; // if set, inside global changes
|
static int batch_change_count = 0; // inside a script
|
||||||
static bool clipboard_needs_update = false; // the clipboard was updated
|
static bool clipboard_needs_update = false; // clipboard was updated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* structure used by block_prep, op_delete and op_yank for blockwise operators
|
* structure used by block_prep, op_delete and op_yank for blockwise operators
|
||||||
@@ -5630,20 +5630,20 @@ static void set_clipboard(int name, yankreg_T *reg)
|
|||||||
(void)eval_call_provider("clipboard", "set", args);
|
(void)eval_call_provider("clipboard", "set", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Avoid clipboard (slow) during batch operations (:global).
|
/// Avoid clipboard (slow) during batch operations (i.e., a script).
|
||||||
void start_global_changes(void)
|
void start_batch_changes(void)
|
||||||
{
|
{
|
||||||
if (++global_change_count > 1) {
|
if (++batch_change_count > 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clipboard_delay_update = true;
|
clipboard_delay_update = true;
|
||||||
clipboard_needs_update = false;
|
clipboard_needs_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update the clipboard after :global changes finished.
|
/// Update the clipboard after batch changes finished.
|
||||||
void end_global_changes(void)
|
void end_batch_changes(void)
|
||||||
{
|
{
|
||||||
if (--global_change_count > 0) {
|
if (--batch_change_count > 0) {
|
||||||
// recursive
|
// recursive
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user