Silence beginning/end-of-line/read-only errors on motions in minibuffer
This commit is contained in:
parent
dacf50627c
commit
24043d9bfd
|
@ -320,6 +320,24 @@ with `doom//reload-theme').")
|
||||||
(advice-add #'load-theme :after #'doom*load-theme-hooks)
|
(advice-add #'load-theme :after #'doom*load-theme-hooks)
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Silence motion errors in minibuffer
|
||||||
|
;;
|
||||||
|
|
||||||
|
(defun doom*silence-motion-errors (orig-fn &rest args)
|
||||||
|
(if (and (minibufferp)
|
||||||
|
(<= (point) (minibuffer-prompt-end)))
|
||||||
|
(progn
|
||||||
|
(ignore-errors (apply orig-fn args))
|
||||||
|
(goto-char (minibuffer-prompt-end)))
|
||||||
|
(apply orig-fn args)))
|
||||||
|
|
||||||
|
(advice-add #'left-char :around #'doom*silence-motion-errors)
|
||||||
|
(advice-add #'right-char :around #'doom*silence-motion-errors)
|
||||||
|
(advice-add #'delete-backward-char :around #'doom*silence-motion-errors)
|
||||||
|
(advice-add #'backward-kill-sentence :around #'doom*silence-motion-errors)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Line numbers
|
;; Line numbers
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user