diff options
| author | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-10-08 20:39:24 +0800 |
|---|---|---|
| committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-10-10 08:30:23 +0800 |
| commit | eac9adf7a10b4162f2e9d438a2da4f6c5d7d458c (patch) | |
| tree | 8c4aa521106fa89999845656c449512b2ebd41b5 /scene | |
| parent | ca25c6e0a3f25948ee4a197f3442c66f019e7424 (diff) | |
Don't allow removing TextEdit's main caret
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/gui/text_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 2e7f650fc2..903e252a76 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4380,7 +4380,7 @@ int TextEdit::add_caret(int p_line, int p_col) { } void TextEdit::remove_caret(int p_caret) { - ERR_FAIL_COND(carets.size() <= 0); + ERR_FAIL_COND_MSG(carets.size() <= 1, "The main caret should not be removed."); ERR_FAIL_INDEX(p_caret, carets.size()); carets.remove_at(p_caret); caret_index_edit_dirty = true; |