From 6af04ed6123a472690c76ac5c5ea1ecaec1d664d Mon Sep 17 00:00:00 2001 From: Keegi Date: Fri, 7 Oct 2011 16:49:53 +0300 Subject: [PATCH] Fix indentation problems in macro editor preventing it to create new multi-line macros --- pronterface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pronterface.py b/pronterface.py index f920df7..1c916b4 100755 --- a/pronterface.py +++ b/pronterface.py @@ -1235,6 +1235,8 @@ class macroed(wx.Dialog): def unindent(self,text): import re self.indent_chars = text[:len(text)-len(text.lstrip())] + if len(self.indent_chars)==0: + self.indent_chars=" " unindented = "" lines = re.split(r"(?:\r\n?|\n)",text) #print lines @@ -1253,7 +1255,8 @@ class macroed(wx.Dialog): return text reindented = "" for line in lines: - reindented += self.indent_chars + line + "\n" + if line.strip() != "": + reindented += self.indent_chars + line + "\n" return reindented class options(wx.Dialog):