mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 13:08:33 +00:00
ops: save and restore clipboard batch status when entering cmdline window
This commit is contained in:
@@ -5755,7 +5755,6 @@ void start_batch_changes(void)
|
||||
return;
|
||||
}
|
||||
clipboard_delay_update = true;
|
||||
clipboard_needs_update = false;
|
||||
}
|
||||
|
||||
/// Counterpart to start_batch_changes().
|
||||
@@ -5767,12 +5766,37 @@ void end_batch_changes(void)
|
||||
}
|
||||
clipboard_delay_update = false;
|
||||
if (clipboard_needs_update) {
|
||||
// must be before, as set_clipboard will invoke
|
||||
// start/end_batch_changes recursively
|
||||
clipboard_needs_update = false;
|
||||
// unnamed ("implicit" clipboard)
|
||||
set_clipboard(NUL, y_previous);
|
||||
clipboard_needs_update = false;
|
||||
}
|
||||
}
|
||||
|
||||
int save_batch_count(void)
|
||||
{
|
||||
int save_count = batch_change_count;
|
||||
batch_change_count = 0;
|
||||
clipboard_delay_update = false;
|
||||
if (clipboard_needs_update) {
|
||||
clipboard_needs_update = false;
|
||||
// unnamed ("implicit" clipboard)
|
||||
set_clipboard(NUL, y_previous);
|
||||
}
|
||||
return save_count;
|
||||
}
|
||||
|
||||
void restore_batch_count(int save_count)
|
||||
{
|
||||
assert(batch_change_count == 0);
|
||||
batch_change_count = save_count;
|
||||
if (batch_change_count > 0) {
|
||||
clipboard_delay_update = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Check whether register is empty
|
||||
static inline bool reg_empty(const yankreg_T *const reg)
|
||||
FUNC_ATTR_PURE
|
||||
|
Reference in New Issue
Block a user