From c24cea177b7de6ae57178496ac04d73b0a9d22f3 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Tue, 25 Oct 2022 20:09:43 -0400 Subject: minimap: check docview has minimap scroll --- plugins/minimap.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/minimap.lua') diff --git a/plugins/minimap.lua b/plugins/minimap.lua index f55b213..9b5a26a 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -608,7 +608,13 @@ end local old_docview_scroll_to_make_visible = DocView.scroll_to_make_visible function DocView:scroll_to_make_visible(line, col, ...) - if not self:is(DocView) and self.v_scrollbar:is_minimap_enabled() then return old_docview_scroll_to_make_visible(self, line, col, ...) end + if + not self:is(DocView) or not self.v_scrollbar:is(MiniMap) + or + not self.v_scrollbar:is_minimap_enabled() + then + return old_docview_scroll_to_make_visible(self, line, col, ...) + end local old_size = self.size.x self.size.x = math.max(0, self.size.x - config.plugins.minimap.width) local result = old_docview_scroll_to_make_visible(self, line, col, ...) -- cgit v1.2.3