fix(paste): improve repeating of pasted text (#30438)

- Fixes 'autoindent' being applied during redo.
- Makes redoing a large paste significantly faster.
- Stores pasted text in the register being recorded.

Fix #28561
This commit is contained in:
zeertzjq
2024-09-22 06:02:48 +08:00
committed by GitHub
parent 1d815acd78
commit e697c1b43d
8 changed files with 233 additions and 32 deletions

View File

@@ -351,6 +351,7 @@ static const struct nv_cmd {
{ K_F1, nv_help, NV_NCW, 0 },
{ K_XF1, nv_help, NV_NCW, 0 },
{ K_SELECT, nv_select, 0, 0 },
{ K_PASTE_START, nv_paste, NV_KEEPREG, 0 },
{ K_EVENT, nv_event, NV_KEEPREG, 0 },
{ K_COMMAND, nv_colon, 0, 0 },
{ K_LUA, nv_colon, 0, 0 },
@@ -6593,6 +6594,12 @@ static void nv_open(cmdarg_T *cap)
}
}
/// Handles K_PASTE_START, repeats pasted text.
static void nv_paste(cmdarg_T *cap)
{
paste_repeat(cap->count1);
}
/// Handle an arbitrary event in normal mode
static void nv_event(cmdarg_T *cap)
{