Skip to content

Commit

Permalink
fix: fix indentation being lost after code blocks and line losing ind…
Browse files Browse the repository at this point in the history
…entation when inserting a line above

fix #10
  • Loading branch information
NathanLovato committed Aug 12, 2024
1 parent 98605b1 commit 18227c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
2 changes: 2 additions & 0 deletions languages/gdscript/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ brackets = [
{ start = "(", end = ")", close = true, newline = true },
{ start = "{", end = "}", close = true, newline = true },
]
auto_indent_using_last_non_empty_line = false
increase_indent_pattern = ":\\s*$"
35 changes: 0 additions & 35 deletions languages/gdscript/indents.scm
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
[
(if_statement)
(for_statement)
(while_statement)
(match_statement)
(pattern_section)

(function_definition)
(constructor_definition)
(class_definition)
(enum_definition)

(dictionary (_))
(array (_))
(setget)
] @indent

[
(if_statement)
(for_statement)
(while_statement)
(match_statement)
(pattern_section)

(function_definition)
(class_definition)
] @extend

[
(return_statement)
(break_statement)
(continue_statement)
(pass_statement)
] @extend.prevent-once

; Add an indent level when adding a line within brackets
(_ "[" "]" @end) @indent
(_ "{" "}" @end) @indent
Expand Down

0 comments on commit 18227c1

Please sign in to comment.