Skip to content
Snippets Groups Projects
Commit ec79bd3c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Corrige l'indentation de régions quand clang-format est inactif

parent 27287f3a
No related branches found
No related tags found
No related merge requests found
...@@ -364,12 +364,11 @@ classique fonctionne encore. ...@@ -364,12 +364,11 @@ classique fonctionne encore.
| ~<TAB>~ | Indente la région comme définie par ~clang-format~ | | ~<TAB>~ | Indente la région comme définie par ~clang-format~ |
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun clang-format-c-mode-common-hook () (defun clang-format-c-mode-common-hook ()
(fset 'c-indent-region 'clang-format-region)
(define-key c-mode-base-map (kbd "<tab>") (define-key c-mode-base-map (kbd "<tab>")
(lambda () (lambda ()
(interactive) (interactive)
(progn (progn
(c-indent-command) (c-indent-line-or-region (region-beginning) (region-end))
(clang-format-region (region-beginning) (region-end)) (clang-format-region (region-beginning) (region-end))
)))) ))))
(add-hook 'c-mode-common-hook 'clang-format-c-mode-common-hook) (add-hook 'c-mode-common-hook 'clang-format-c-mode-common-hook)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment