mirror of
https://github.com/wuelnerdotexe/vim-astro.git
synced 2025-12-07 01:34:26 +08:00
fix(syntax): the astro fence is detected correctly
This commit is contained in:
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.1.2] - 2022-08-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- The astro fence delimiter is detected and colored correctly.
|
||||
|
||||
## [1.1.1] - 2022-08-07
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -12,10 +12,10 @@ Provides syntax highlighting and indentation support for `.astro` files.
|
||||
## Features
|
||||
|
||||
- Syntax highlighting for embedded languages:
|
||||
- JavaScript and JSX.
|
||||
- TypeScript and TSX.
|
||||
- CSS, SCSS, SASS, and LESS.
|
||||
- Stylus (need external support).
|
||||
- JavaScript and JSX.
|
||||
- TypeScript and TSX.
|
||||
- CSS, SCSS, SASS, and LESS.
|
||||
- Stylus (need external support).
|
||||
- Indentation (experimental).
|
||||
- Code folding.
|
||||
- No dependencies.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.5 MiB |
@@ -1,12 +1,16 @@
|
||||
" Vim ftdetect file.
|
||||
" Language: Astro
|
||||
" Author: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" Maintainer: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" URL: https://github.com/wuelnerdotexe/vim-astro
|
||||
" Last Change: 2022 Aug 05
|
||||
" Based On: Evan Lecklider's vim-svelte
|
||||
" Changes: See https://github.com/evanleck/vim-svelte
|
||||
" Credits: See vim-svelte on github
|
||||
|
||||
" Last Change: 2022 Aug 22
|
||||
|
||||
" Whether to set the Astro filetype on *.astro files.
|
||||
autocmd BufNewFile,BufRead *.astro setfiletype astro
|
||||
function! s:DetectFiletypeAstro()
|
||||
if (&filetype ==# '') || (&filetype !=# 'astro')
|
||||
setfiletype astro
|
||||
endif
|
||||
endfunction
|
||||
|
||||
autocmd BufNewFile,BufRead *.astro call <SID>DetectFiletypeAstro()
|
||||
" vim: ts=8
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
" Vim indent file (experimental).
|
||||
" Language: Astro
|
||||
" Author: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" Maintainer: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" URL: https://github.com/wuelnerdotexe/vim-astro
|
||||
" Last Change: 2022 Aug 05
|
||||
" Last Change: 2022 Aug 07
|
||||
" Based On: Evan Lecklider's vim-svelte
|
||||
" Changes: See https://github.com/evanleck/vim-svelte
|
||||
" Credits: See vim-svelte on github
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
" Vim syntax file.
|
||||
" Language: Astro
|
||||
" Author: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" Maintainer: Wuelner Martínez <wuelner.martinez@outlook.com>
|
||||
" URL: https://github.com/wuelnerdotexe/vim-astro
|
||||
" Last Change: 2022 Aug 05
|
||||
" Last Change: 2022 Aug 22
|
||||
" Based On: Evan Lecklider's vim-svelte
|
||||
" Changes: See https://github.com/evanleck/vim-svelte
|
||||
" Credits: See vim-svelte on github
|
||||
@@ -27,7 +28,7 @@ set cpoptions&vim
|
||||
" Embedded HTML syntax.
|
||||
runtime! syntax/html.vim
|
||||
|
||||
" htmlTagName: expand HTML tag names to include mixed case, periods.
|
||||
" htmlTagName: expand HTML tag names to include mixed case and periods.
|
||||
syntax match htmlTagName contained "\<[a-zA-Z\.]*\>"
|
||||
|
||||
" astroDirectives: add Astro Directives to HTML arguments.
|
||||
@@ -58,13 +59,15 @@ else
|
||||
syntax include @astroJavaScript syntax/javascript.vim
|
||||
endif
|
||||
|
||||
" astroFence: detect the Astro fence.
|
||||
syntax match astroFence contained +^---$+
|
||||
|
||||
" astrojavaScript: add TypeScript support to Astro code fence.
|
||||
syntax region astroJavaScript
|
||||
\ start=+---+
|
||||
\ start=+^---$+
|
||||
\ keepend
|
||||
\ end=+---+
|
||||
\ contains=htmlTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment,htmlEndTag
|
||||
\ matchgroup=astroFence
|
||||
\ end=+^---$+
|
||||
\ contains=htmlTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment,htmlEndTag,astroFence
|
||||
\ fold
|
||||
|
||||
unlet b:current_syntax
|
||||
@@ -144,6 +147,7 @@ unlet b:current_syntax
|
||||
" this plugin to support it: https://github.com/wavded/vim-stylus
|
||||
if g:astro_stylus == 'enable'
|
||||
try
|
||||
" Embedded Stylus syntax.
|
||||
syntax include @astroStylus syntax/stylus.vim
|
||||
|
||||
" stylusStyle: add Stylus style tags support in Astro.
|
||||
|
||||
Reference in New Issue
Block a user