From 0bcbd0015f93b69c8043e0c0fffb0dffc4abe522 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 16 Aug 2022 16:18:56 +0200 Subject: [PATCH] tweaks: check the multiline regexes only for Delete and Backspace The checking for all functions that are marked as not-okay-for-view-mode was excessive and unneeded. It had been inherited from commit d47d8cd4 from thirteen years ago, and was never verified for correctness. This addresses the main part of https://savannah.gnu.org/bugs/?62903. --- src/nano.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nano.c b/src/nano.c index f6bfd30d..85f9d551 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1666,12 +1666,14 @@ void process_a_keystroke(void) also_the_last = FALSE; } #endif + + if (!refresh_needed && (function == do_delete || function == do_backspace)) { #ifdef ENABLE_COLOR - if (!refresh_needed && changes_something(function)) check_the_multis(openfile->current); + if (!refresh_needed) #endif - if (!refresh_needed && (function == do_delete || function == do_backspace)) - update_line(openfile->current, openfile->current_x); + update_line(openfile->current, openfile->current_x); + } #ifndef NANO_TINY if (bracketed_paste)