Fixed bug in CodeFileEditor allowing to remove NEWLINE character between section header and section code
--- a/editors/CodeFileEditor.py Fri May 10 11:48:04 2013 +0200
+++ b/editors/CodeFileEditor.py Fri May 10 11:49:22 2013 +0200
@@ -273,9 +273,16 @@
if self.CallTipActive():
self.CallTipCancel()
key = event.GetKeyCode()
-
- if (self.GetLineState(self.LineFromPosition(self.GetSelection()[0])) and
- key not in NAVIGATION_KEYS):
+ caret = self.GetSelection()[0]
+ print (key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE],
+ self.GetLineState(self.LineFromPosition(min(len(self.GetText()), caret + 1))))
+
+ if (self.GetLineState(self.LineFromPosition(caret)) and
+ key not in NAVIGATION_KEYS or
+ key == wx.WXK_BACK and
+ 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)))):
return
elif key == 32 and event.ControlDown():