Commit 6af04ed6 authored by Keegi's avatar Keegi

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

parent d1f2ebd7
...@@ -1235,6 +1235,8 @@ class macroed(wx.Dialog): ...@@ -1235,6 +1235,8 @@ class macroed(wx.Dialog):
def unindent(self,text): def unindent(self,text):
import re import re
self.indent_chars = text[:len(text)-len(text.lstrip())] self.indent_chars = text[:len(text)-len(text.lstrip())]
if len(self.indent_chars)==0:
self.indent_chars=" "
unindented = "" unindented = ""
lines = re.split(r"(?:\r\n?|\n)",text) lines = re.split(r"(?:\r\n?|\n)",text)
#print lines #print lines
...@@ -1253,6 +1255,7 @@ class macroed(wx.Dialog): ...@@ -1253,6 +1255,7 @@ class macroed(wx.Dialog):
return text return text
reindented = "" reindented = ""
for line in lines: for line in lines:
if line.strip() != "":
reindented += self.indent_chars + line + "\n" reindented += self.indent_chars + line + "\n"
return reindented return reindented
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment