feature/evil: redesign +evil:align; bang = repeat align

This commit is contained in:
Henrik Lissner 2018-03-20 23:55:24 -04:00
parent 5711bfc903
commit a26755a089
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -167,15 +167,14 @@ evil-window-move-* (e.g. `evil-window-move-far-left')"
;;;###autoload (autoload '+evil:align "feature/evil/autoload/evil" nil t)
(evil-define-operator +evil:align (beg end pattern &optional bang)
"Ex interface to `align-regexp'. Accepts vim-style regexps."
(interactive "<r><//><!>")
"Ex interface to `align-regexp'. PATTERN is a vim-style regexp. If BANG,
repeat the alignment for all matches (otherwise just the first match on each
line)."
(interactive "<r><//g><!>")
(align-regexp
beg end
(concat "\\(\\s-*\\)"
(if bang
(regexp-quote pattern)
(evil-transform-vim-style-regexp pattern)))
1 1))
(concat "\\(\\s-*\\)" (evil-transform-vim-style-regexp pattern))
1 1 bang))
;; --- wgrep ------------------------------