diff options
Diffstat (limited to 'core/.find.lua')
-rw-r--r-- | core/.find.lua | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/core/.find.lua b/core/.find.lua index bea87c36..40829cb1 100644 --- a/core/.find.lua +++ b/core/.find.lua @@ -33,7 +33,7 @@ module('textadept.find') --- -- Textadept's find table. -- @class table --- @name textadept.find +-- @name find -- @field find_entry_text The text in the find entry. -- @field replace_entry_text The text in the replace entry. -- @field match_case Flag indicating whether or not case-sensitive search is @@ -53,68 +53,20 @@ find = { function focus() end --- --- [Local table] Text escape sequences with their associated characters. --- @class table --- @name escapes -local escapes = {} - ---- --- Finds and selects text in the current buffer. --- This is used by the find dialog. It is recommended to use the --- buffer:search_in_target() or buffer:search_next() and buffer:search_prev() --- functions for scripting. --- @param text The text to find. --- @param next Flag indicating whether or not the search direction is forward. --- @param flags Search flags. This is a number mask of 4 flags: match case (2), --- whole word (4), Lua pattern (8), and in files (16) joined with binary OR. --- If nil, this is determined based on the checkboxes in the find box. --- @param nowrap Flag indicating whether or not the search won't wrap. --- @param 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. --- @return position of the found text or -1 -function find.find(text, next, flags, nowrap, wrapped) end - ---- --- 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. --- This function ignores 'Find in Files'. --- @param 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. --- @see find.find -function find.replace(rtext) end - ---- --- Replaces all found text. --- This function is used by the find dialog. It is not recommended to call it --- via scripts. --- If any text is selected, all found text in that selection is replaced. --- This function ignores 'Find in Files'. --- @param ftext The text to find. --- @param rtext The text to replace found text with. --- @param flags The number mask identical to the one in 'find'. --- @see find.find -function find.replace_all(ftext, rtext, flags) end - ---- -- Mimicks a press of the 'Find Next' button in the Find box. -function find.call_find_next() end +function find_next() end --- -- Mimicks a press of the 'Find Prev' button in the Find box. -function find.call_find_prev() end +function find_prev() end --- -- Mimicks a press of the 'Replace' button in the Find box. -function find.call_replace() end +function replace() end --- -- Mimicks a press of the 'Replace All' button in the Find box. -function find.call_replace_all() end +function replace_all() end --- -- Goes to the next or previous file found relative to the file |