Attempt to autodetect target language (D/C++) in extra/vim/syntax/propane.vim

This commit is contained in:
Josh Holtrop 2026-06-29 23:02:57 -04:00
parent 23834bef82
commit 232af68081
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@
### New Features ### New Features
- Add `noline` grammar statement to skip emitting `#line` directives - Add `noline` grammar statement to skip emitting `#line` directives
- Attempt to autodetect target language (D/C++) in extra/vim/syntax/propane.vim
### Fixes ### Fixes

View File

@ -8,7 +8,11 @@ if exists("b:current_syntax")
endif endif
if !exists("b:propane_subtype") if !exists("b:propane_subtype")
let b:propane_subtype = "d" if search('\<import\s\+\%(std\|core\)\.', 'nw') > 0
let b:propane_subtype = "d"
else
let b:propane_subtype = "cpp"
endif
endif endif
exe "syn include @propaneTarget syntax/".b:propane_subtype.".vim" exe "syn include @propaneTarget syntax/".b:propane_subtype.".vim"