diff options
Diffstat (limited to 'src/qreg-commands.c')
| -rw-r--r-- | src/qreg-commands.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c index a6390a1..0c4c8d4 100644 --- a/src/qreg-commands.c +++ b/src/qreg-commands.c @@ -563,13 +563,11 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre sptr_t pos = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); if (str.len > 0) { - teco_interface_ssm(SCI_BEGINUNDOACTION, 0, 0); teco_interface_ssm(SCI_ADDTEXT, str.len, (sptr_t)str.data); - teco_interface_ssm(SCI_ENDUNDOACTION, 0, 0); teco_ring_dirtify(); if (teco_current_doc_must_undo()) - undo__teco_interface_ssm(SCI_UNDO, 0, 0); + undo__teco_interface_ssm(SCI_DELETERANGE, pos, str.len); } teco_undo_int(teco_ranges[0].from) = teco_current_doc_get_dot(); @@ -835,17 +833,10 @@ teco_state_copytoqreg_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg, /* * If @-modified, cut into the register */ - if (teco_current_doc_must_undo()) { - undo__teco_interface_ssm(SCI_GOTOPOS, pos, 0); - undo__teco_interface_ssm(SCI_UNDO, 0, 0); - } + if (teco_current_doc_must_undo()) + teco_undo_interface_insert(from, len); - /* - * Should always generate an undo action. - */ - teco_interface_ssm(SCI_BEGINUNDOACTION, 0, 0); teco_interface_ssm(SCI_DELETERANGE, from, len); - teco_interface_ssm(SCI_ENDUNDOACTION, 0, 0); teco_ring_dirtify(); if (from+len < pos) |
