diff --git a/pyqode/core/modes/backspace.py b/pyqode/core/modes/backspace.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/modes/backspace.py
+++ b/pyqode/core/modes/backspace.py
@@ -25,6 +25,9 @@ class SmartBackSpaceMode(Mode):
             if self.editor.textCursor().atBlockStart():
                 return
             tab_len = self.editor.tab_length
+            tab_len = self.editor.textCursor().positionInBlock() % tab_len
+            if tab_len == 0:
+                tab_len = self.editor.tab_length
             # count the number of spaces deletable, stop at tab len
             spaces = 0
             cursor = QtGui.QTextCursor(self.editor.textCursor())
Make smart backspace smarter: now it will align with the correct indentation level