You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported by: Sebastien Mondet (Bitbucket: smondet, GitHub: smondet)
When I try
(evil-define-text-object evil-a-double-quote-no-extend (count &optional beg end type)
"Select a double-quoted expression."
:extend-selection nil
(evil-select-quote ?\" beg end type count t))
(define-key evil-outer-text-objects-map "\"" 'evil-a-double-quote-no-extend)
keys like va" still extend the selection to the whitespace around the quotes (I've checked it's indeed evil-a-double-quote-no-extend begin called).
It's “hard-coded” in the function evil-select-quote-thing: evil-common.el:3258.
;; add whitespace
(cond
((not inclusive) (setq beg (1+ beg) end (1- end)))
((not (eq inclusive 'quote-only))
;; try to add whitespace in forward direction
(goto-char (if (> dir 0) end beg))
(if (setq bnd (bounds-of-thing-at-point 'evil-space))
(if (> dir 0) (setq end (cdr bnd)) (setq beg (car bnd)))
;; if not found try backward direction
(goto-char (if (> dir 0) beg end))
(if (and wsboth (setq bnd (bounds-of-thing-at-point 'evil-space)))
(if (> dir 0) (setq beg (car bnd)) (setq end (cdr bnd)))))))
The second problem is that we cannot set the inclusive parameter to 'quote-only beacuse a bit earlier, the function overrides it loosing the
information:
(if inclusive (setq inclusive t)
(when (= (abs count) 2)
(setq count dir)
(setq inclusive 'quote-only))
;; never extend with exclusive selection
(setq beg nil end nil))
By just replacing with this:
(if inclusive (setq inclusive inclusive)
Then I can get this to work (extend-selection being just ignored):
(evil-define-text-object evil-a-double-quote-no-extend (count &optional beg end type)
"Select a double-quoted expression."
:extend-selection nil
(evil-select-quote ?\" beg end type count 'quote-only))
Originally reported by: Sebastien Mondet (Bitbucket: smondet, GitHub: smondet)
When I try
keys like
va"
still extend the selection to the whitespace around the quotes (I've checked it's indeedevil-a-double-quote-no-extend
begin called).It's “hard-coded” in the function
evil-select-quote-thing
:evil-common.el:3258
.The second problem is that we cannot set the
inclusive
parameter to'quote-only
beacuse a bit earlier, the function overrides it loosing theinformation:
By just replacing with this:
Then I can get this to work (
extend-selection
being just ignored):The text was updated successfully, but these errors were encountered: