diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-05-16 23:23:46 +0200 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-05-16 23:46:14 +0200 |
commit | 242b94af1aa87d9c255a7cb1747049fc1da107e5 (patch) | |
tree | aa89db4732114658ae9e610a1d7bd496e5706413 /doc | |
parent | 163687d17a8a11da3cf1a3595c511a5f8fc94571 (diff) |
TextEdit search returns a dictionary instead of Vector
Easier to use than accessing elements in a Vector using indices given by an enum.
Breaks compatibility on existing scripts using this functionality.
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> |