From 1dc0d8cc0ba71c0d8f23028e4ecc17ceb6ff0899 Mon Sep 17 00:00:00 2001 From: pengguanjun <1570320831@qq.com> Date: Tue, 19 Jan 2021 00:47:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20riseide/laxer/codepad.py.=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E5=AD=97=E7=AC=A6=E4=B8=B2=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8A=A0=E5=8E=BB=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=E4=BB=8D=E6=9C=AA=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- riseide/laxer/codepad.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/riseide/laxer/codepad.py b/riseide/laxer/codepad.py index a25e2c5..0df2fe4 100644 --- a/riseide/laxer/codepad.py +++ b/riseide/laxer/codepad.py @@ -273,7 +273,10 @@ class CodePad(stc.StyledTextCtrl): for i in range(10): self.Tab() start, end = self.GetSelection() cont = self.GetSelectedText() - iscomment = cont.strip()[0]=='#' + if cont == '': + iscomment = False + else: + iscomment = cont.strip()[0]=='#' if not iscomment and com!=False: rptxt = cont.replace(' '*40, '# ') self.ReplaceSelection(rptxt) -- Gitee