From d29c8ab81b8b32f99e42153c7708c99a9eab3b55 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Thu, 31 Oct 2019 12:35:23 +0100 Subject: Improved TextEdit search usability & documentation --- doc/classes/TextEdit.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'doc/classes') 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 @@ - 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] @@ -504,6 +512,12 @@ Search from end to beginning. + + Used to access the result column from [member search]. + + + Used to access the result line from [member search]. + Cuts (Copies and clears) the selected text. -- cgit v1.2.3