Fix indentation problems in macro editor preventing it to create new multi-line macros

master
Keegi 2011-10-07 16:49:53 +03:00
parent d1f2ebd717
commit 6af04ed612
1 changed files with 4 additions and 1 deletions

View File

@ -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):