Skip to content

Commit d92f243

Browse files
Theodor ThornhillTheodor Thornhill
Theodor Thornhill
authored and
Theodor Thornhill
committed
Add agressive indent
1 parent 542ddf2 commit d92f243

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

csharp-tree-sitter.el

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
;; Version : 0.10.0
99
;; Keywords : c# languages oop mode
1010
;; X-URL : https://github.com/josteink/csharp-mode
11-
;; Package-Requires: ((emacs "26.1") (tree-sitter "0.12.1") (tree-sitter-indent "0.1"))
11+
;; Package-Requires: ((emacs "26.1") (tree-sitter "0.12.1") (tree-sitter-indent "0.1") (aggressive-indent "1.8.4"))
1212

1313
;; This program is free software; you can redistribute it and/or modify
1414
;; it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@
3030
(require 'tree-sitter)
3131
(require 'tree-sitter-hl)
3232
(require 'tree-sitter-indent)
33+
(require 'aggressive-indent)
3334

3435
;;; Tree-sitter
3536

@@ -271,7 +272,7 @@ Key bindings:
271272
(setq csharp-mode-map nil)
272273
(setq-local tree-sitter-indent-current-scopes csharp-mode-indent-scopes)
273274
(setq-local tree-sitter-indent-offset csharp-mode-indent-offset)
274-
(setq-local indent-line-function #'csharp-mode-indent-line)
275+
(setq-local indent-line-function #'tree-sitter-indent-line)
275276

276277
;; https://github.com/ubolonton/emacs-tree-sitter/issues/84
277278
(unless font-lock-defaults
@@ -281,7 +282,8 @@ Key bindings:
281282
(setq-local comment-start "// ")
282283
(setq-local comment-end "")
283284

284-
(tree-sitter-hl-mode))
285+
(tree-sitter-hl-mode)
286+
(aggressive-indent-mode))
285287

286288
;;;###autoload
287289
(add-to-list 'tree-sitter-major-mode-language-alist '(csharp-tree-sitter-mode . c-sharp))

0 commit comments

Comments
 (0)