Fix indentation problems in macro editor preventing it to create new multi-line macros
parent
d1f2ebd717
commit
6af04ed612
|
@ -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,6 +1255,7 @@ class macroed(wx.Dialog):
|
|||
return text
|
||||
reindented = ""
|
||||
for line in lines:
|
||||
if line.strip() != "":
|
||||
reindented += self.indent_chars + line + "\n"
|
||||
return reindented
|
||||
|
||||
|
|
Loading…
Reference in New Issue