diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-20 13:28:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 13:28:29 +0200 |
commit | d3612d04c76e2b9cc840633ed6b7cdf5ac2ad3fe (patch) | |
tree | 079cb46849f97ff22e003ae95d4c4108f0d4d67d /doc | |
parent | c404fe5848a99c22cdeb4868456b5334b0bf2e72 (diff) | |
parent | 242b94af1aa87d9c255a7cb1747049fc1da107e5 (diff) |
Merge pull request #38794 from nekomatata/text-edit-search-result
TextEdit search returns Dictionary instead of Vector
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/TextEdit.xml | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index e553518b39..0c6615c53b 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -299,7 +299,7 @@ </description> </method> <method name="search" qualifiers="const"> - <return type="PackedInt32Array"> + <return type="Dictionary"> </return> <argument index="0" name="key" type="String"> </argument> @@ -311,13 +311,13 @@ </argument> <description> Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. - Returns an empty [code]PackedInt32Array[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g: + Returns an empty [code]Dictionary[/code] if no result was found. Otherwise, returns a [code]Dictionary[/code] containing [code]line[/code] and [code]column[/code] entries, e.g: [codeblock] var result = search(key, flags, line, column) - if result.size() > 0: + if !result.empty(): # Result found. - var res_line = result[TextEdit.SEARCH_RESULT_LINE] - var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] + var line_number = result.line + var column_number = result.column [/codeblock] </description> </method> @@ -536,12 +536,6 @@ <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 [method search]. - </constant> - <constant name="SEARCH_RESULT_LINE" value="1" enum="SearchResult"> - Used to access the result line from [method search]. - </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> Cuts (copies and clears) the selected text. </constant> |