Fix #2756: make C-a/C-e truly shift-select aware
This commit is contained in:
parent
7d71584a8d
commit
8f685a3c31
2 changed files with 8 additions and 12 deletions
|
@ -155,11 +155,8 @@ in some cases."
|
||||||
"Jump between the indentation column (first non-whitespace character) and the
|
"Jump between the indentation column (first non-whitespace character) and the
|
||||||
beginning of the line. The opposite of
|
beginning of the line. The opposite of
|
||||||
`doom/forward-to-last-non-comment-or-eol'."
|
`doom/forward-to-last-non-comment-or-eol'."
|
||||||
(interactive "d")
|
(interactive "^d")
|
||||||
(let ((pt (or point (point))))
|
(let ((pt (or point (point))))
|
||||||
(when (and shift-select-mode this-command-keys-shift-translated)
|
|
||||||
(set-mark pt)
|
|
||||||
(activate-mark))
|
|
||||||
(cl-destructuring-bind (bol bot _eot _eol)
|
(cl-destructuring-bind (bol bot _eot _eol)
|
||||||
(doom--bol-bot-eot-eol pt)
|
(doom--bol-bot-eot-eol pt)
|
||||||
(cond ((> pt bot)
|
(cond ((> pt bot)
|
||||||
|
@ -180,11 +177,8 @@ beginning of the line. The opposite of
|
||||||
(defun doom/forward-to-last-non-comment-or-eol (&optional point)
|
(defun doom/forward-to-last-non-comment-or-eol (&optional point)
|
||||||
"Jumps between the last non-blank, non-comment character in the line and the
|
"Jumps between the last non-blank, non-comment character in the line and the
|
||||||
true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
|
true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
|
||||||
(interactive "d")
|
(interactive "^d")
|
||||||
(let ((pt (or point (point))))
|
(let ((pt (or point (point))))
|
||||||
(when (and shift-select-mode this-command-keys-shift-translated)
|
|
||||||
(set-mark pt)
|
|
||||||
(activate-mark))
|
|
||||||
(cl-destructuring-bind (_bol _bot eot eol)
|
(cl-destructuring-bind (_bol _bot eot eol)
|
||||||
(doom--bol-bot-eot-eol pt)
|
(doom--bol-bot-eot-eol pt)
|
||||||
(cond ((< pt eot)
|
(cond ((< pt eot)
|
||||||
|
|
|
@ -378,10 +378,12 @@
|
||||||
|
|
||||||
;; A Doom convention where C-s on popups and interactive searches will invoke
|
;; A Doom convention where C-s on popups and interactive searches will invoke
|
||||||
;; ivy/helm for their superior filtering.
|
;; ivy/helm for their superior filtering.
|
||||||
(define-key! :keymaps +default-minibuffer-maps
|
(when-let (command (cond ((featurep! :completion ivy)
|
||||||
"C-s" (if (featurep! :completion ivy)
|
#'counsel-minibuffer-history)
|
||||||
#'counsel-minibuffer-history
|
((featurep! :completion helm)
|
||||||
#'helm-minibuffer-history))
|
#'helm-minibuffer-history)))
|
||||||
|
(define-key! :keymaps +default-minibuffer-maps
|
||||||
|
"C-s" command))
|
||||||
|
|
||||||
;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation.
|
;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation.
|
||||||
;; Pressing it again will send you to the true bol. Same goes for C-e, except
|
;; Pressing it again will send you to the true bol. Same goes for C-e, except
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue