--- a/editors/CodeFileEditor.py Fri May 10 12:11:54 2013 +0200
+++ b/editors/CodeFileEditor.py Fri May 10 13:06:47 2013 +0200
@@ -206,11 +206,14 @@
for section in SECTIONS_NAMES:
section_comments = self.SectionsComments[section]
text += section_comments["comment"]
- if not parts[section].startswith("\n") or parts[section] == "\n":
+ if parts[section] == "":
- if not parts[section].endswith("\n"):
+ if not parts[section].startswith("\n"): + if not parts[section].endswith("\n"): def RefreshView(self, scroll_to_highlight=False):
@@ -273,16 +276,12 @@
- caret = self.GetSelection()[0]
- print (key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE],
- self.GetLineState(self.LineFromPosition(min(len(self.GetText()), caret + 1))))
+ current_pos = self.GetSelection()[0] - if (self.GetLineState(self.LineFromPosition(caret)) and
- key not in NAVIGATION_KEYS or
- self.GetLineState(self.LineFromPosition(max(0, caret - 1))) or
- key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE] and
- self.GetLineState(self.LineFromPosition(min(len(self.GetText()), caret + 1)))):
+ if (self.GetLineState(self.LineFromPosition(current_pos)) and + key not in NAVIGATION_KEYS + [ elif key == 32 and event.ControlDown():