diff --git a/NEWS.adoc b/NEWS.adoc index 722ea38a0..f3dad2cfc 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -14,7 +14,8 @@ Bug fixes: Improvements: - Open the blob corresponding to the diff line. (#1334) - - Keep cursor position when toggling file-filter in the main view. + - Keep cursor position in the main view when toggling + file-filter and rev-filter. - Make errors visible in views showing Git output. (#1346) - Allow different colors for all references types. - Enable search in sections titles. (#1043) diff --git a/src/prompt.c b/src/prompt.c index 193fbbbcd..ad4766a64 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -874,8 +874,10 @@ prompt_toggle(struct view *view, const char *argv[], enum view_flag *flags) toggle = find_option_info(option_toggles, ARRAY_SIZE(option_toggles), "", option); if (toggle) { - if (view_has_flags(view, VIEW_FILE_FILTER) && - !strcmp(toggle->name, "file_filter")) + if ((view_has_flags(view, VIEW_FILE_FILTER) && + !strcmp(toggle->name, "file_filter")) || + (view_has_flags(view, VIEW_REV_FILTER) && + !strcmp(toggle->name, "rev_filter"))) string_copy_rev(view->env->goto_id, view->env->commit); return prompt_toggle_option(view, argv, "", toggle, flags); }