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 /scene/gui/text_edit.cpp | |
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 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 932dda2f9d..e050b3f174 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5447,17 +5447,16 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc return col; } -Vector<int> TextEdit::_search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const { +Dictionary TextEdit::_search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const { int col, line; if (search(p_key, p_search_flags, p_from_line, p_from_column, line, col)) { - Vector<int> result; - result.resize(2); - result.set(SEARCH_RESULT_COLUMN, col); - result.set(SEARCH_RESULT_LINE, line); + Dictionary result; + result["line"] = line; + result["column"] = col; return result; } else { - return Vector<int>(); + return Dictionary(); } } @@ -6980,9 +6979,6 @@ void TextEdit::_bind_methods() { BIND_ENUM_CONSTANT(SEARCH_WHOLE_WORDS); BIND_ENUM_CONSTANT(SEARCH_BACKWARDS); - BIND_ENUM_CONSTANT(SEARCH_RESULT_COLUMN); - BIND_ENUM_CONSTANT(SEARCH_RESULT_LINE); - /* ClassDB::bind_method(D_METHOD("delete_char"),&TextEdit::delete_char); ClassDB::bind_method(D_METHOD("delete_line"),&TextEdit::delete_line); |