Fix out-of-bounds error in doom/backward-delete-whitespace-to-column

This commit is contained in:
Henrik Lissner 2017-04-04 03:35:10 -04:00
parent 62e906cf19
commit 2eafdc8c6f

View file

@ -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