diff --git a/core/autoload/editor.el b/core/autoload/editor.el index 0660813a9..209d15f71 100644 --- a/core/autoload/editor.el +++ b/core/autoload/editor.el @@ -112,7 +112,7 @@ possible, or just one char if that's not possible." (setq movement tab-width)) (save-match-data (if (string-match "\\w*\\(\\s-+\\)$" - (buffer-substring-no-properties (- p movement) p)) + (buffer-substring-no-properties (max (point-min) (- p movement)) p)) (delete-char (- 0 (- (match-end 1) (match-beginning 1)))) (call-interactively 'delete-backward-char))))) ;; Otherwise do a regular delete