From 4efa1b6906789d786e2a356dc572348347cc02db Mon Sep 17 00:00:00 2001 From: Yuri Roubinski Date: Sun, 25 Aug 2019 09:57:59 +0300 Subject: [PATCH] Disallow undo/redo in readonly TextEdit's --- scene/gui/text_edit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f8c31121be7..1f493e3913a 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3506,6 +3506,10 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { } break; case KEY_Z: { + if (readonly) { + break; + } + if (!k->get_command()) { scancode_handled = false; break; @@ -3518,6 +3522,10 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { } break; case KEY_Y: { + if (readonly) { + break; + } + if (!k->get_command()) { scancode_handled = false; break;