languages: Fix Bash indentation issues with multi-cursors, newlines, and keyword outdenting (#35116)
Closes #34390 This PR fixes several Bash indentation issues: - Adding indentation or comment using multi cursors no longer breaks relative indentation - Adding newline now places the cursor at the correct indent - Typing a valid keyword triggers context-aware auto outdent It also adds tests for all of them. Release Notes: - Fixed various issues with handling indentation in Bash.
This commit is contained in:
parent
07252c3309
commit
43d0aae617
5 changed files with 459 additions and 25 deletions
|
@ -1,12 +1,12 @@
|
|||
(function_definition
|
||||
"function"?
|
||||
body: (
|
||||
_
|
||||
"{" @start
|
||||
"}" @end
|
||||
)) @indent
|
||||
(_ "[" "]" @end) @indent
|
||||
(_ "{" "}" @end) @indent
|
||||
(_ "(" ")" @end) @indent
|
||||
|
||||
(array
|
||||
"(" @start
|
||||
")" @end
|
||||
) @indent
|
||||
(function_definition) @start.function
|
||||
(if_statement) @start.if
|
||||
(elif_clause) @start.elif
|
||||
(else_clause) @start.else
|
||||
(for_statement) @start.for
|
||||
(while_statement) @start.while
|
||||
(case_statement) @start.case
|
||||
(case_item) @start.case_item
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue