commit 67b5eae12158038ee5cb00b808702891527cd70e from: Christian Weisgerber date: Mon Dec 27 19:01:57 2021 UTC tog: clear search highlighting when reloading view Clear the search highlighting when replacing the content of a diff view ('<', '>', '[', ']', 'a', 'w') or a blame view ('b', 'p', 'B'). Previously the position would remain highlighted even if the text there had changed. ok stsp@ or a blame view commit - 197088a4e27004293735c7fc011bb92e1bf8fe75 commit + 67b5eae12158038ee5cb00b808702891527cd70e blob - 689aa4b67e0bcae980ac8b0f007f11c145528be1 blob + 4416f593bba3dbb60a7843b0b4a2dba74aa17ba2 --- tog/tog.c +++ tog/tog.c @@ -3699,6 +3699,7 @@ input_diff_view(struct tog_view **new_view, struct tog wclear(view->window); s->first_displayed_line = 1; s->last_displayed_line = view->nlines; + s->matched_line = 0; diff_view_indicate_progress(view); err = create_diff(s); break; @@ -3757,6 +3758,7 @@ input_diff_view(struct tog_view **new_view, struct tog case '[': if (s->diff_context > 0) { s->diff_context--; + s->matched_line = 0; diff_view_indicate_progress(view); err = create_diff(s); if (s->first_displayed_line + view->nlines - 1 > @@ -3769,6 +3771,7 @@ input_diff_view(struct tog_view **new_view, struct tog case ']': if (s->diff_context < GOT_DIFF_MAX_CONTEXT) { s->diff_context++; + s->matched_line = 0; diff_view_indicate_progress(view); err = create_diff(s); } @@ -3793,6 +3796,7 @@ input_diff_view(struct tog_view **new_view, struct tog s->first_displayed_line = 1; s->last_displayed_line = view->nlines; + s->matched_line = 0; diff_view_indicate_progress(view); err = create_diff(s); @@ -3817,6 +3821,7 @@ input_diff_view(struct tog_view **new_view, struct tog s->first_displayed_line = 1; s->last_displayed_line = view->nlines; + s->matched_line = 0; diff_view_indicate_progress(view); err = create_diff(s); @@ -4369,6 +4374,7 @@ run_blame(struct tog_view *view) s->last_displayed_line = view->nlines; s->selected_line = 1; } + s->matched_line = 0; done: if (blob)