aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--core/events.lua6
-rw-r--r--core/init.lua4
-rw-r--r--modules/textadept/find.lua10
3 files changed, 11 insertions, 9 deletions
diff --git a/core/events.lua b/core/events.lua
index 0569b09a..9d84a48c 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -117,7 +117,7 @@ local M = {}
--
-- * _`text`_: The error message text.
-- @field FIND (string)
--- Emitted in order to find text via the Find & Replace Pane.
+-- Emitted to find text via the Find & Replace Pane.
-- Arguments:
--
-- * _`text`_: The text to search for.
@@ -191,7 +191,7 @@ local M = {}
-- procedure.
-- Emitted by [`quit()`]().
-- @field REPLACE (string)
--- Emitted in order to replace selected (found) text.
+-- Emitted to replace selected (found) text.
-- Arguments:
--
-- * _`text`_: The replacement text.
@@ -227,7 +227,7 @@ local M = {}
-- + `buffer.UPDATE_CONTENT`
-- Buffer contents, styling, or markers have changed.
-- + `buffer.UPDATE_SELECTION`
--- Buffer selection has changed.
+-- Buffer selection has changed (including caret movement).
-- + `buffer.UPDATE_V_SCROLL`
-- Buffer has scrolled vertically.
-- + `buffer.UPDATE_H_SCROLL`
diff --git a/core/init.lua b/core/init.lua
index 779dfab9..c05d6404 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -132,13 +132,13 @@ local view
local quit
---
--- Resets the Lua state by reloading all initialization scripts.
+-- Resets the Lua State by reloading all initialization scripts.
-- Language modules for opened files are NOT reloaded. Re-opening the files that
-- use them will reload those modules instead.
-- This function is useful for modifying user scripts (such as
-- *~/.textadept/init.lua* and *~/.textadept/modules/textadept/keys.lua*) on
-- the fly without having to restart Textadept. `arg` is set to `nil` when
--- reinitializing the Lua state. Any scripts that need to differentiate between
+-- reinitializing the Lua State. Any scripts that need to differentiate between
-- startup and reset can test `arg`.
-- @class function
-- @name reset
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 6b4efeee..30f9d0e3 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -200,6 +200,8 @@ local function find(text, next, flags, no_wrap, wrapped)
end
events.connect(events.FIND, find)
+local incremental_start
+
-- Finds and selects text incrementally in the current buffer from a starting
-- position.
-- Flags other than `FIND_MATCHCASE` are ignored.
@@ -209,10 +211,10 @@ events.connect(events.FIND, find)
-- position.
local function find_incremental(text, next, anchor)
if anchor then
- M._incremental_start = buffer:position_relative(buffer.current_pos,
- next and 1 or -1)
+ incremental_start = buffer:position_relative(buffer.current_pos,
+ next and 1 or -1)
end
- buffer:goto_pos(M._incremental_start or 0)
+ buffer:goto_pos(incremental_start or 0)
find(text, next, M.match_case and buffer.FIND_MATCHCASE or 0)
end
@@ -233,7 +235,7 @@ end
-- @name find_incremental
function M.find_incremental(text, next, anchor)
if text then find_incremental(text, next, anchor) return end
- M._incremental_start = buffer.current_pos
+ incremental_start = buffer.current_pos
ui.command_entry:set_text('')
ui.command_entry.enter_mode('find_incremental')
end