diff options
author | 2020-08-18 18:44:49 -0400 | |
---|---|---|
committer | 2020-08-18 18:44:49 -0400 | |
commit | 459b16e6f0092b5629ab9896cb673eef303bf71e (patch) | |
tree | 4edff2349cf8d4b6935d06934fbede029b57089d /modules/textadept/find.lua | |
parent | 89981d00b7823d3dfbb8dff1c414a7b639baba90 (diff) | |
download | textadept-459b16e6f0092b5629ab9896cb673eef303bf71e.tar.gz textadept-459b16e6f0092b5629ab9896cb673eef303bf71e.zip |
Center the caret vertically for find results.
Iterating through find results seems a bit more intuitive. Also, for small views
the scrolling was way too disorienting.
Diffstat (limited to 'modules/textadept/find.lua')
-rw-r--r-- | modules/textadept/find.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 34174ff7..4a1bdf7d 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -201,7 +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() |