tweaks: move two checks plus corresponding calls to a better place
It was silly to check again specifically for <Del> and <Bsp> after any possible keystroke had been handled. It was an anomaly. This makes the tail of do_deletion() similar to the tail of inject(). (That sometimes the current line is redrawn twice is acceptable -- how often does one type <Backspace> while having Shift-selected something? Normally one wouldn't, because it would cancel the selection, so it's fine to accept some inefficiency for this case.)
Этот коммит содержится в:
родитель
11178e14ab
Коммит
e31d59ebc8
@ -97,6 +97,13 @@ void do_deletion(undo_type action)
|
|||||||
/* We're at the end-of-file: nothing to do. */
|
/* We're at the end-of-file: nothing to do. */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef ENABLE_COLOR
|
||||||
|
if (!refresh_needed)
|
||||||
|
check_the_multis(openfile->current);
|
||||||
|
#endif
|
||||||
|
if (!refresh_needed)
|
||||||
|
update_line(openfile->current, openfile->current_x);
|
||||||
|
|
||||||
/* Adjust the file size, and remember it for a possible redo. */
|
/* Adjust the file size, and remember it for a possible redo. */
|
||||||
openfile->totsize--;
|
openfile->totsize--;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
|
10
src/nano.c
10
src/nano.c
@ -1665,17 +1665,7 @@ void process_a_keystroke(void)
|
|||||||
} else if (openfile->current != was_current)
|
} else if (openfile->current != was_current)
|
||||||
also_the_last = FALSE;
|
also_the_last = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!refresh_needed && (function == do_delete || function == do_backspace)) {
|
|
||||||
#ifdef ENABLE_COLOR
|
|
||||||
check_the_multis(openfile->current);
|
|
||||||
if (!refresh_needed)
|
|
||||||
#endif
|
|
||||||
update_line(openfile->current, openfile->current_x);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
|
||||||
if (bracketed_paste)
|
if (bracketed_paste)
|
||||||
suck_up_input_and_paste_it();
|
suck_up_input_and_paste_it();
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user