From 154f727c7a7b766e5a2013c6eeb17fb843e9d7a4 Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 22 Jan 2024 18:26:16 -0500 Subject: Overhaul TextEdit selection. The caret is now a part of the selection. --- doc/classes/TextEdit.xml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index db0c1f17b0..72893c913a 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -58,7 +58,7 @@ - + Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid. @@ -363,6 +363,15 @@ [b]Note:[/b] The return value is influenced by [theme_item line_spacing] and [theme_item font_size]. And it will not be less than [code]1[/code]. + + + + + + Returns an [Array] of line ranges where [code]x[/code] is the first line and [code]y[/code] is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it. + If a selection's end column ([method get_selection_to_column]) is at column [code]0[/code], that line will not be included. If a selection begins on the line after another selection ends and [param p_merge_adjacent] is [code]true[/code], or they begin and end on the same line, one line range will include both selections. + + @@ -514,7 +523,17 @@ Returns the text inside the selection of a caret, or all the carets if [param caret_index] is its default value [code]-1[/code]. - + + + + + + + Returns the caret index of the selection at the given [param line] and [param column], or [code]-1[/code] if there is none. + If [param include_edges] is [code]false[/code], the position must be inside the selection and not at either end. + + + @@ -809,7 +828,7 @@ - + Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. If no results are found, both are equal to [code]-1[/code]. @@ -1049,9 +1068,6 @@ - - - Sets the current selection mode. -- cgit v1.2.3