summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorRandy Taylor <dev@rjt.dev>2023-01-24 21:20:48 -0500
committerEli Zaretskii <eliz@gnu.org>2023-01-26 10:29:07 +0200
commit4bf7cb71edc2694c9939ae27594e9a1e3b79e1c6 (patch)
tree6edb8bd6adc78e8ec5e791c3da138f4e44b9e972 /lisp/progmodes
parentff9498624fcd15e2ab6264d259d089aa5f989ae6 (diff)
downloademacs-4bf7cb71edc2694c9939ae27594e9a1e3b79e1c6.tar.gz
emacs-4bf7cb71edc2694c9939ae27594e9a1e3b79e1c6.tar.bz2
emacs-4bf7cb71edc2694c9939ae27594e9a1e3b79e1c6.zip
Fix go-ts-mode indentation and set indent offset to 8 (Bug#61006)
* lisp/progmodes/go-ts-mode.el (go-ts-mode-indent-offset): Change default value to 8. (go-ts-mode--indent-rules): Add indentation for parameters and interfaces.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/go-ts-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el
index d552e1360e0..5f3e1ea3e68 100644
--- a/lisp/progmodes/go-ts-mode.el
+++ b/lisp/progmodes/go-ts-mode.el
@@ -38,7 +38,7 @@
(declare-function treesit-node-type "treesit.c")
(declare-function treesit-search-subtree "treesit.c")
-(defcustom go-ts-mode-indent-offset 4
+(defcustom go-ts-mode-indent-offset 8
"Number of spaces for each indentation step in `go-ts-mode'."
:version "29.1"
:type 'integer
@@ -78,8 +78,10 @@
((parent-is "expression_switch_statement") parent-bol 0)
((parent-is "field_declaration_list") parent-bol go-ts-mode-indent-offset)
((parent-is "import_spec_list") parent-bol go-ts-mode-indent-offset)
+ ((parent-is "interface_type") parent-bol go-ts-mode-indent-offset)
((parent-is "labeled_statement") parent-bol go-ts-mode-indent-offset)
((parent-is "literal_value") parent-bol go-ts-mode-indent-offset)
+ ((parent-is "parameter_list") parent-bol go-ts-mode-indent-offset)
((parent-is "type_spec") parent-bol go-ts-mode-indent-offset)
((parent-is "var_declaration") parent-bol go-ts-mode-indent-offset)
(no-node parent-bol 0)))