From 125a4f3ea11136e441c19de5ab840a011f410e07 Mon Sep 17 00:00:00 2001 From: serr Date: Tue, 4 Feb 2025 15:12:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B2=D0=B2=D0=BE=D0=B4=20=D1=82=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=BA=D0=BE=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B1=D0=B0=D0=B9?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=D1=8B=D0=BC=D0=B8=20=D1=81=D0=B8=D0=BC=D0=B2?= =?UTF-8?q?=D0=BE=D0=BB=D0=B0=D0=BC=D0=B8=20(=D0=B2=20=D1=81=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D0=B0=D0=B5=20=D0=B5=D1=81=D0=BB=D0=B8=20=D1=8D=D1=82?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B5=20=D1=83=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D1=8E=D1=89=D0=B8=D0=B9=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE?= =?UTF-8?q?=D0=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mvc/controllers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mvc/controllers.py b/mvc/controllers.py index 0c1d1cb..4e327f6 100644 --- a/mvc/controllers.py +++ b/mvc/controllers.py @@ -18,7 +18,11 @@ class EditController: case self.adapter.KEY_BACKSPACE_1: self.model.Backspace() case self.adapter.KEY_BACKSPACE_2: self.model.Backspace() case self.adapter.KEY_CTRL_S: self.model.SaveFile() - case _: self.model.InsertSymbol(symbolCode) + case _: + if symbolCode > 127 or symbolCode < 0: + print("Only 1-byte symbols!") + return False + self.model.InsertSymbol(symbolCode) self.model.Scroll(self.adapter.lines, self.adapter.cols) return True \ No newline at end of file