summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-01 14:10:00 +0100
committerGitHub <noreply@github.com>2019-11-01 14:10:00 +0100
commita49c8d4a2bece25d5afd40495d482df514258563 (patch)
tree57827e0fc2050275e6011d2525f5d64518435aa0 /doc/classes
parentb4737877f11e21f0e52e6c8d185fd5e775482ebf (diff)
parentd29c8ab81b8b32f99e42153c7708c99a9eab3b55 (diff)
Merge pull request #33202 from nekomatata/text-edit-search-usability
Improved TextEdit search usability & documentation
Diffstat (limited to 'doc/classes')
-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>