Fix clang-format-region-or-buffer and change binding to C-c f
This commit is contained in:
parent
fbfa5e04a8
commit
bf2e563410
@ -1291,8 +1291,8 @@
|
||||
(defun clang-format-region-or-buffer ()
|
||||
"Format the region if it's active, otherwise format the entire buffer."
|
||||
(interactive)
|
||||
(if (region-active-p)
|
||||
(clang-format-region)
|
||||
(if (use-region-p)
|
||||
(clang-format-region (region-beginning) (region-end))
|
||||
(clang-format-buffer)))
|
||||
#+end_src
|
||||
|
||||
@ -1302,7 +1302,7 @@
|
||||
(add-hook
|
||||
'c-mode-hook
|
||||
(lambda ()
|
||||
(define-key c-mode-map (kbd "C-M-f")
|
||||
(define-key c-mode-map (kbd "C-c f")
|
||||
'clang-format-region-or-buffer)))
|
||||
#+end_src
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user