editors/CodeFileEditor.py
changeset 1150 b1c84771e1cf
parent 1146 510d1ea1f6c1
child 1152 0a8fbd2a00f7
--- a/editors/CodeFileEditor.py	Wed May 15 23:27:19 2013 +0200
+++ b/editors/CodeFileEditor.py	Thu May 16 00:00:35 2013 +0200
@@ -295,7 +295,7 @@
         
         # Test if caret is before Windows like new line
         text = self.GetText()
-        if ord(text[current_pos]) == 13:
+        if current_pos < len(text) and ord(text[current_pos]) == 13:
             newline_size = 2
         else:
             newline_size = 1