feat(format): add +format/org-block-in-region
Also updates `+org/reformat-at-point` to call `+format/org-block-in-region` if selection is active. Fix: #7936
This commit is contained in:
parent
378d0b8db6
commit
7543b04e15
4 changed files with 91 additions and 27 deletions
|
@ -135,6 +135,19 @@ Uses `evil-visual-end' if available."
|
|||
(marker-position evil-visual-end))
|
||||
(region-end)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-region (&optional as-list)
|
||||
"Return the bounds of the current seelction.
|
||||
|
||||
If AS-LIST is non-nil, returns (BEG END). Otherwise returns a cons cell (BEG .
|
||||
END)."
|
||||
(let* ((active (doom-region-active-p))
|
||||
(beg (if active (doom-region-beginning)))
|
||||
(end (if active (doom-region-end))))
|
||||
(if as-list
|
||||
(list beg end)
|
||||
(cons beg end))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-thing-at-point-or-region (&optional thing prompt)
|
||||
"Grab the current selection, THING at point, or xref identifier at point.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue