From af925d603bc7632ff87918ad1ad080032fb3c0a5 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sat, 11 Sep 2021 03:37:12 +0200 Subject: [PATCH] Fix `doc` selection in `findreplace` Use `last_view` if `active_view` is `CommandView`. --- data/core/commands/findreplace.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/core/commands/findreplace.lua b/data/core/commands/findreplace.lua index cff023d2..67aa90d5 100644 --- a/data/core/commands/findreplace.lua +++ b/data/core/commands/findreplace.lua @@ -14,7 +14,8 @@ local find_regex = config.find_regex or false local found_expression local function doc() - return core.active_view:is(DocView) and core.active_view.doc or last_view.doc + local is_DocView = core.active_view:is(DocView) and not core.active_view:is(CommandView) + return is_DocView and core.active_view.doc or last_view.doc end local function get_find_tooltip()