765 key_handled = True |
765 key_handled = True |
766 elif key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER: |
766 elif key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER: |
767 if self.TextSyntax in ["ST", "ALL"]: |
767 if self.TextSyntax in ["ST", "ALL"]: |
768 indent = self.Editor.GetLineIndentation(line) |
768 indent = self.Editor.GetLineIndentation(line) |
769 if LineStartswith(lineText.strip(), self.BlockStartKeywords): |
769 if LineStartswith(lineText.strip(), self.BlockStartKeywords): |
770 indent += 2 |
770 indent = (indent / 2 + 1) * 2 |
771 self.Editor.AddText("\n" + " " * indent) |
771 self.Editor.AddText("\n" + " " * indent) |
772 key_handled = True |
772 key_handled = True |
773 elif key == wx.WXK_BACK: |
773 elif key == wx.WXK_BACK: |
774 if self.TextSyntax in ["ST", "ALL"]: |
774 if self.TextSyntax in ["ST", "ALL"]: |
775 indent = self.Editor.GetLineIndentation(line) |
775 indent = self.Editor.GetLineIndentation(line) |
776 if lineText.strip() == "" and indent > 0: |
776 if lineText.strip() == "" and indent > 0: |
777 self.Editor.DelLineLeft() |
777 self.Editor.DelLineLeft() |
778 self.Editor.AddText(" " * max(0, indent - 2)) |
778 self.Editor.AddText(" " * ((max(0, indent - 1) / 2) * 2)) |
779 key_handled = True |
779 key_handled = True |
780 if not key_handled: |
780 if not key_handled: |
781 event.Skip() |
781 event.Skip() |
782 |
782 |
783 def OnKillFocus(self, event): |
783 def OnKillFocus(self, event): |