Allow auto-indenting with syntax errors when using regex-based indent matches to improve bash auto-indent behavior (#24160)

- Fixes auto-indent issues around `elif` caused by auto-indent being prevented due to syntax errors generated before `elif` clause completed

Release Notes:

- Fixed an issue where inserting an elif before an else in bash would
not properly auto-indent

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Ben Kunkle 2025-02-03 21:34:37 -06:00 committed by GitHub
parent 66d0cdfd91
commit 8742c18107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 53 additions and 8 deletions

View file

@ -24,5 +24,5 @@ brackets = [
### fi
### ```
increase_indent_pattern = "(\\s*|;)(do|then|in|else|elif)\\b.*$"
decrease_indent_pattern = "(\\s*|;)(fi|done|esac|else|elif)\\b.*$"
decrease_indent_pattern = "(\\s*|;)\\b(fi|done|esac|else|elif)\\b.*$"
# make sure to test each line mode & block mode