   (if indent-tabs-mode
       (call-interactively 'backward-delete-char)
     (save-excursion
-      (unless (looking-back "^[\s\t]*")
+      (unless (looking-back "^[\s\t]*" (line-beginning-position))
         (doom--goto-first-non-blank))
       (let* ((movement (% (current-column) tab-width))
              (spaces (if (= 0 movement) tab-width (- tab-width movement))))

        (funcall goto-char-fn eoc)))))

(defun doom--surrounded-p ()
  (and (looking-back "[[{(]\\(\s+\\|\n\\)?\\(\s\\|\t\\)*")
       (let* ((whitespace (match-string 1))
              (match-str (concat whitespace (match-string 2) "[])}]")))
         (looking-at-p match-str))))

        (save-match-data
          (if (string-match "\\w*\\(\\s-+\\)$"
                            (buffer-substring-no-properties (- p movement) p))
              (delete-char (- 0 (- (match-end 1) (match-beginning 1))))
            (call-interactively 'delete-backward-char)))))
     ;; Otherwise do a regular delete
     (t (call-interactively 'delete-backward-char)))))
