Error if +default/lsp-format-region-or-buffer in non-lsp buffer
This commit is contained in:
parent
6bb597564b
commit
6f1665563c
1 changed files with 2 additions and 0 deletions
|
@ -311,6 +311,8 @@ ARG is set, prompt for a known project to search from."
|
||||||
(defun +default/lsp-format-region-or-buffer ()
|
(defun +default/lsp-format-region-or-buffer ()
|
||||||
"Format the buffer (or selection) with LSP."
|
"Format the buffer (or selection) with LSP."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(unless (bound-and-true-p lsp-mode)
|
||||||
|
(user-error "Not in an LSP buffer"))
|
||||||
(call-interactively
|
(call-interactively
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
#'lsp-format-region
|
#'lsp-format-region
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue