From f95573558f3a418b000884c585c34211d682582c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 2 Sep 2020 09:31:52 -0400 Subject: First scroll find results into view, then vertically center the caret. Otherwise, find results on long lines will not be displayed. --- modules/textadept/find.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 9654c988..c5c3118d 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -201,6 +201,7 @@ local function find(text, next, flags, no_wrap, wrapped) local f = next and buffer.search_next or buffer.search_prev local pos = f(buffer, flags, text) view:ensure_visible_enforce_policy(buffer:line_from_position(pos)) + view:scroll_range(buffer.anchor, buffer.current_pos) view:vertical_center_caret() -- Track find text and found text for "replace all" and incremental find. find_text, found_text = text, buffer:get_sel_text() -- cgit v1.2.3