Module textadept.find
Textadept's integrated find/replace dialog. [Dummy file]
Usage
In addition to offering standard find and replace, Textadept allows you to
find with Lua patterns and replace with Lua captures and even Lua code! Lua
captures (%n) are available for a Lua pattern search and embedded Lua code
enclosed in %() is always available.
Functions
| find.find (text, flags, next, nowrap, wrapped) |
Finds and selects text in the current buffer. |
| find.replace (rtext) |
Replaces found text. |
| find.replace_all (ftext, rtext, flags) |
Replaces all found text. |
| focus () |
Displays and focuses the find/replace dialog. |
Tables
| escapes |
[Local table] Text escape sequences with their associated characters. |
| textadept.find |
Textadept's find table. |
Functions
- find.find (text, flags, next, nowrap, wrapped)
-
Finds and selects text in the current buffer. This is used by the find dialog. It is recommended to use the buffer:find() function for scripting.
Parameters
-
text: The text to find.
-
flags: Search flags. This is a number mask of 3 flags: match case (2), whole word (4), and Lua pattern (8) joined with binary AND.
-
next: Flag indicating whether or not the search direction is forward.
-
nowrap: Flag indicating whether or not the search won't wrap.
-
wrapped: Utility flag indicating whether or not the search has wrapped for displaying useful statusbar information. This flag is used and set internally, and should not be set otherwise.
- find.replace (rtext)
-
Replaces found text. This function is used by the find dialog. It is not recommended to call it via scripts. textadept.find.find is called first, to select any found text. The selected text is then replaced by the specified replacement text.
Parameters
-
rtext: The text to replace found text with. It can contain both Lua capture items (%n where 1 <= n <= 9) for Lua pattern searches and %() sequences for embedding Lua code for any search.
- find.replace_all (ftext, rtext, flags)
-
Replaces all found text. This function is used by the find dialog. It is not recommended to call it via scripts.
Parameters
-
ftext: The text to find.
-
rtext: The text to replace found text with.
-
flags: The number mask identical to the one in 'find'.
See also:
find.find
- focus ()
-
Displays and focuses the find/replace dialog.
Tables
- escapes
- [Local table] Text escape sequences with their associated characters.
- textadept.find
- Textadept's find table.
Fields
-
find_entry_text: The text in the find entry.
-
replace_entry_text: The text in the replace entry.