summaryrefslogtreecommitdiff
path: root/doc/classes/TextEdit.xml
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-10-31 12:35:23 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-10-31 12:35:23 +0100
commitd29c8ab81b8b32f99e42153c7708c99a9eab3b55 (patch)
tree4d454229978dd9b346b3b2f960e5897313fbfea2 /doc/classes/TextEdit.xml
parent99324d9fdac44a528d54027b8997b4cf44e5934e (diff)
Improved TextEdit search usability & documentation
Diffstat (limited to 'doc/classes/TextEdit.xml')
-rw-r--r--doc/classes/TextEdit.xml16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 0dd2d75cd5..71a949a4af 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -310,7 +310,15 @@
<argument index="3" name="from_column" type="int">
</argument>
<description>
- Perform a search inside the text. Search flags can be specified in the[code]SEARCH_*[/code] enum.
+ Perform a search inside the text. Search flags can be specified in the [code]SEARCH_*[/code] enum.
+ Returns an empty [code]PoolIntArray[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [code]SEARCH_RESULT_*[/code] enum, e.g:
+ [codeblock]
+ var result = search(key, flags, line, column)
+ if result.size() > 0:
+ # result found
+ var res_line = result[TextEdit.SEARCH_RESULT_LINE]
+ var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
+ [/codeblock]
</description>
</method>
<method name="select">
@@ -504,6 +512,12 @@
<constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags">
Search from end to beginning.
</constant>
+ <constant name="SEARCH_RESULT_COLUMN" value="0" enum="SearchResult">
+ Used to access the result column from [member search].
+ </constant>
+ <constant name="SEARCH_RESULT_LINE" value="1" enum="SearchResult">
+ Used to access the result line from [member search].
+ </constant>
<constant name="MENU_CUT" value="0" enum="MenuItems">
Cuts (Copies and clears) the selected text.
</constant>