mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-21 23:33:26 +01:00
Add support for comments after section headers (closes #1259)
There's no canonical definition of what's the INI syntax, but Python's `ConfigParser` supports comments after section headers: ```ini [section] ; comment ```
This commit is contained in:
parent
aa205c6a9f
commit
5e0b7f013a
2
assets/README.md
vendored
2
assets/README.md
vendored
@ -33,7 +33,7 @@ The following files have been manually modified after converting from a `.tmLang
|
||||
|
||||
* `Apache.sublime_syntax`=> removed `.conf` and `.CONF` file types.
|
||||
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
|
||||
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types and support for comments after section headers
|
||||
* `Org mode.sublime-syntax` => removed `task` file type.
|
||||
* `SML.sublime_syntax` => removed `ml` file type.
|
||||
|
||||
|
3
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
3
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
@ -25,12 +25,13 @@ contexts:
|
||||
scope: comment.line.semicolon.ini
|
||||
captures:
|
||||
1: punctuation.definition.comment.ini
|
||||
- match: '^\s*(\[)(.*?)(\])'
|
||||
- match: '^\s*(\[)(.*?)(\])\s*(;.*)?$\n?'
|
||||
scope: meta.tag.section.ini
|
||||
captures:
|
||||
1: punctuation.definition.section.ini
|
||||
2: entity.section.ini
|
||||
3: punctuation.definition.section.ini
|
||||
4: comment.definition.section.ini
|
||||
- match: '^(\s*(["'']?)(.+?)(\2)\s*(=))?\s*((["'']?)(.*?)(\7))\s*(;.*)?$\n?'
|
||||
scope: meta.declaration.ini
|
||||
captures:
|
||||
|
Loading…
Reference in New Issue
Block a user