editors/TextViewer.py
changeset 1613 41ca586da9dc
parent 1578 f8e2a04c4445
child 1637 6f4624687b89
--- a/editors/TextViewer.py	Thu Dec 22 17:39:58 2016 +0300
+++ b/editors/TextViewer.py	Fri Dec 23 18:40:31 2016 +0300
@@ -894,11 +894,12 @@
                     key_handled = True
             elif key == wx.WXK_BACK:
                 if self.TextSyntax in ["ST", "ALL"]:
-                    indent = self.Editor.GetLineIndentation(line)
-                    if lineText.strip() == "" and indent > 0:
-                        self.Editor.DelLineLeft()
-                        self.Editor.AddText(" " * ((max(0, indent - 1) / 2) * 2))
-                        key_handled = True
+                    if not self.Editor.GetSelectedText():
+                        indent = self.Editor.GetColumn(self.Editor.GetCurrentPos())
+                        if lineText.strip() == "" and len(lineText) > 0 and indent > 0:
+                            self.Editor.DelLineLeft()
+                            self.Editor.AddText(" " * ((max(0, indent - 1) / 2) * 2))
+                            key_handled = True
             if not key_handled:
                 event.Skip()
         else: