Fix bash path_suffixes and add cmd-/ line comment support (#2827)

<img width="1608" alt="SCR-20230806-cyrg"
src="https://github.com/zed-industries/zed/assets/19867440/2491c4bc-5797-4417-9633-08c136b4e8fe">

I noticed we weren't highlghting bash files if the shebang line didn't
exist. After checking, it looks like the `.` were accidentally added to
the `path_suffixes` list. This PR fixes that and adds in support for
`cmd-/` to trigger line comments.

<img width="1608" alt="SCR-20230806-czxh"
src="https://github.com/zed-industries/zed/assets/19867440/37dd0c8e-c4e7-49e2-9997-9dd8145f460e">


Release Notes:

- Fixed a bug where shell files weren't syntax highlighted if a shebang
didn't exist.
- Added support for `cmd-/` to add line comments to shell files.
This commit is contained in:
Joseph T. Lyons 2023-08-06 02:35:00 -04:00 committed by GitHub
commit e3a4d174de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
name = "Shell Script"
path_suffixes = [".sh", ".bash", ".bashrc", ".bash_profile", ".bash_aliases", ".bash_logout", ".profile", ".zsh", ".zshrc", ".zshenv", ".zsh_profile", ".zsh_aliases", ".zsh_histfile", ".zlogin"]
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin"]
line_comment = "# "
first_line_pattern = "^#!.*\\b(?:ba|z)?sh\\b"
brackets = [
{ start = "[", end = "]", close = true, newline = false },