Use lsp-format-region-or-buffer if available
Currently the user has to select `SPC c F` for lsp format. But if lsp-mode is enabled, the user will always want to use the LSP formatter. So this changes the default `SPC c f` to use lsp formatter if available. This simplifies the interface a bit so the user doesn't have to worry about selecting the "right" format, just like how other commands get auto bound to LSP functions.
This commit is contained in:
parent
35591cfc4c
commit
300bc65918
3 changed files with 5 additions and 5 deletions
|
@ -219,9 +219,11 @@ snippets or single lines."
|
|||
is selected)."
|
||||
(interactive)
|
||||
(call-interactively
|
||||
(if (use-region-p)
|
||||
#'+format/region
|
||||
#'+format/buffer)))
|
||||
(if (bound-and-true-p lsp-mode)
|
||||
#'+default/lsp-format-region-or-buffer
|
||||
(if (use-region-p)
|
||||
#'+format/region
|
||||
#'+format/buffer))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue