diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2022-06-21 03:07:16 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2022-06-21 03:27:54 +0200 |
commit | d6126b318a55b06a1fde717e92c47bb9b3696708 (patch) | |
tree | 9eaa163b1c8d790403c55772b9fbf1962cb69046 /src/search.c | |
parent | 2b93e15597f82c5bf324c317b3e9d6462dde770b (diff) | |
download | sciteco-d6126b318a55b06a1fde717e92c47bb9b3696708.tar.gz |
fixed rubout of certain constructs like Ifoo$FRX$$
* avoid emitting SCI_UNDO undo tokens if the Scintilla undo action would actually be empty
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index 219ddb2..80b8ea2 100644 --- a/src/search.c +++ b/src/search.c @@ -914,7 +914,9 @@ teco_state_search_kill_done(teco_machine_main_t *ctx, const teco_string_t *str, teco_interface_ssm(SCI_ENDUNDOACTION, 0, 0); teco_ring_dirtify(); - if (teco_current_doc_must_undo()) + /* NOTE: An undo action is not always created. */ + if (teco_current_doc_must_undo() && + teco_search_parameters.dot != dot) undo__teco_interface_ssm(SCI_UNDO, 0, 0); return &teco_state_start; @@ -1065,7 +1067,7 @@ teco_state_replace_default_insert_done_overwrite(teco_machine_main_t *ctx, const } else { g_auto(teco_string_t) replace_str = {NULL, 0}; if (!replace_reg->vtable->get_string(replace_reg, &replace_str.data, &replace_str.len, error) || - !teco_state_insert_process(ctx, &replace_str, replace_str.len, error)) + (replace_str.len > 0 && !teco_state_insert_process(ctx, &replace_str, replace_str.len, error))) return NULL; } |