Godot Engine – Multi-platform 2D and 3D game engine
Add note to TextEdit, CodeEdit, and LineEdit docs about using zero-based line and column numbers
Malcolm Anderson9f896816a8f9
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xmlindex 5e29ae55cbc..bda0acc2bcc 100644--- a/doc/classes/CodeEdit.xml+++ b/doc/classes/CodeEdit.xml@@ -6,6 +6,7 @@<description>CodeEdit is a specialized [TextEdit] designed for editing plain text code files. It has many features commonly found in code editors such as line numbers, line folding, code completion, indent management, and string/comment management.[b]Note:[/b] Regardless of locale, [CodeEdit] will by default always use left-to-right text direction to correctly display source code.+ [note]Being a subclass of [TextEdit], line and column numbers are [i]zero-based[/i], like elements of an array. For example, the first line of text can be retrieved by [code]get_line(0)[/code], the second line by [code]get_line(1)[/code], and so on.[/note]</description><tutorials></tutorials>diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xmlindex edf9a3e8384..720190845e7 100644--- a/doc/classes/LineEdit.xml+++ b/doc/classes/LineEdit.xml@@ -38,6 +38,7 @@- [kbd]Cmd + Left Arrow[/kbd]: Same as [kbd]Home[/kbd], move the caret to the beginning of the line- [kbd]Cmd + Right Arrow[/kbd]: Same as [kbd]End[/kbd], move the caret to the end of the line[b]Note:[/b] Caret movement shortcuts listed above are not affected by [member shortcut_keys_enabled].+ [note]Column numbers are [i]zero-based[/i], like elements of an array. For example, [member caret_column] being [code]0[/code] indicates the caret is on the first column (i.e., before the first character).[/note]</description><tutorials></tutorials>diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xmlindex 760fd20f9d2..7c746d22ce5 100644--- a/doc/classes/TextEdit.xml+++ b/doc/classes/TextEdit.xml@@ -11,6 +11,7 @@- To enter Windows codepoints, hold [kbd]Alt[/kbd] and type the code on the numpad. For example, to enter the character [code]á[/code] (Windows 0225), hold [kbd]Alt[/kbd] and type [kbd]0[/kbd], [kbd]2[/kbd], [kbd]2[/kbd], [kbd]5[/kbd] on the numpad. The leading zero here must [b]not[/b] be omitted, as this is how Windows codepoints are distinguished from OEM codepoints.[b]Note:[/b] Most viewport, caret, and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets in the order they were created.[b]Note:[/b] When holding down [kbd]Alt[/kbd], the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.+ [note]Line and column numbers are [i]zero-based[/i], like elements of an array. For example, the first line of text can be retrieved by [code]get_line(0)[/code], the second line by [code]get_line(1)[/code], and so on.[/note]</description><tutorials></tutorials>