tweaks: make the triggering of the recalculation of multidata less eager
Also, trigger recalculation when an undo or redo causes a large enough forward jump.
Этот коммит содержится в:
родитель
e6e22ea976
Коммит
eea3e1f0b2
16
src/search.c
16
src/search.c
@ -739,6 +739,12 @@ void ask_for_and_do_replacements(void)
|
|||||||
/* Go to the specified line and x position. */
|
/* Go to the specified line and x position. */
|
||||||
void goto_line_posx(ssize_t line, size_t pos_x)
|
void goto_line_posx(ssize_t line, size_t pos_x)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_COLOR
|
||||||
|
if (line > openfile->edittop->lineno + editwinrows ||
|
||||||
|
(ISSET(SOFTWRAP) && line > openfile->current->lineno))
|
||||||
|
recook |= perturbed;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (openfile->current = openfile->filetop; line > 1 &&
|
for (openfile->current = openfile->filetop; line > 1 &&
|
||||||
openfile->current != openfile->filebot; line--)
|
openfile->current != openfile->filebot; line--)
|
||||||
openfile->current = openfile->current->next;
|
openfile->current = openfile->current->next;
|
||||||
@ -798,7 +804,8 @@ void goto_line_and_column(ssize_t line, ssize_t column, bool retain_answer,
|
|||||||
line = 1;
|
line = 1;
|
||||||
|
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
if (line > openfile->edittop->lineno + editwinrows - 1 || ISSET(SOFTWRAP))
|
if (line > openfile->edittop->lineno + editwinrows ||
|
||||||
|
(ISSET(SOFTWRAP) && line > openfile->current->lineno))
|
||||||
recook |= perturbed;
|
recook |= perturbed;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1004,12 +1011,13 @@ void go_to_and_confirm(linestruct *line)
|
|||||||
if (line != openfile->current) {
|
if (line != openfile->current) {
|
||||||
openfile->current = line;
|
openfile->current = line;
|
||||||
openfile->current_x = 0;
|
openfile->current_x = 0;
|
||||||
edit_redraw(was_current, CENTERING);
|
|
||||||
statusbar(_("Jumped to anchor"));
|
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
if (line->lineno > was_current->lineno)
|
if (line->lineno > openfile->edittop->lineno + editwinrows ||
|
||||||
|
(ISSET(SOFTWRAP) && line->lineno > was_current->lineno))
|
||||||
recook |= perturbed;
|
recook |= perturbed;
|
||||||
#endif
|
#endif
|
||||||
|
edit_redraw(was_current, CENTERING);
|
||||||
|
statusbar(_("Jumped to anchor"));
|
||||||
} else if (openfile->current->has_anchor)
|
} else if (openfile->current->has_anchor)
|
||||||
statusline(REMARK, _("This is the only anchor"));
|
statusline(REMARK, _("This is the only anchor"));
|
||||||
else
|
else
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user