Change behavior of BANG for +evil:narrow-buffer

BANG = use indirect buffers, otherwise, narrow/widen the current buffer.
This commit is contained in:
Henrik Lissner 2019-09-14 18:32:14 -04:00
parent f7c368c5da
commit ab8b31e5bc
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -135,11 +135,17 @@ integration."
;;;###autoload (autoload '+evil:narrow-buffer "editor/evil/autoload/evil" nil t)
(evil-define-operator +evil:narrow-buffer (beg end &optional bang)
"Wrapper around `doom/clone-and-narrow-buffer'."
"Narrow the buffer to region between BEG and END.
Widens narrowed buffers first. If BANG, use indirect buffer clones instead."
:move-point nil
(interactive "<r><!>")
(if bang
(doom/widen-indirectly-narrowed-buffer bang)
(if (not bang)
(if (buffer-narrowed-p)
(widen)
(narrow-to-region beg end))
(when (buffer-narrowed-p)
(doom/widen-indirectly-narrowed-buffer t))
(doom/narrow-buffer-indirectly beg end)))
;;;###autoload