aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/find.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-12-19 15:26:31 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2010-12-19 15:26:31 -0500
commitfdd68d51e9bcbaac89f77e235fef2f596aa35b97 (patch)
treed279232f3f333a353a95bca6a85dec68dadc768a /modules/textadept/find.lua
parent34a576b5ed1618f5e5aed0950fcfaed07e0a71ce (diff)
downloadtextadept-fdd68d51e9bcbaac89f77e235fef2f596aa35b97.tar.gz
textadept-fdd68d51e9bcbaac89f77e235fef2f596aa35b97.zip
Use buffer.selection_start and buffer.selection_end.
Diffstat (limited to 'modules/textadept/find.lua')
-rw-r--r--modules/textadept/find.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 202f7b49..3798ead9 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -256,9 +256,8 @@ local function replace_all(ftext, rtext, flags)
count = count + 1
end
else
- local anchor, current_pos = buffer.anchor, buffer.current_pos
+ local anchor, current_pos = buffer.selection_start, buffer.selection_end
local s, e = anchor, current_pos
- if s > e then s, e = e, s end
buffer:insert_text(e, '\n')
local end_marker = buffer:marker_add(buffer:line_from_position(e + 1),
MARK_FIND)