diff --git a/riseide/laxer/codepad.py b/riseide/laxer/codepad.py index a25e2c5a517a2439b1325ad74789f98bc997bf87..0df2fe4e088851734cb143b0b71c5a559c5dcc27 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)