From a1cbbd72224bdc5c8c5059f313d0138d009d8e4b Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke <marijnh@gmail.com>
Date: Wed, 1 Apr 2015 10:25:39 +0200
Subject: [PATCH] [sublime keymap] Fix backspacing across the start of a line

Closes #3170
---
 keymap/sublime.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/keymap/sublime.js b/keymap/sublime.js
index cf185736..441456f5 100644
--- a/keymap/sublime.js
+++ b/keymap/sublime.js
@@ -416,7 +416,7 @@
     var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);
     var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize"));
 
-    if (!/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0)
+    if (toStartOfLine && !/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0)
       return cm.indentSelection("subtract");
     else
       return CodeMirror.Pass;
-- 
GitLab