diff --git a/CHANGELOG.md b/CHANGELOG.md index 24afdbe..b7326e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 6798398..b3bcced 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/assets/vim-astro.png b/assets/vim-astro.png index d952275..b6e5494 100644 Binary files a/assets/vim-astro.png and b/assets/vim-astro.png differ diff --git a/ftdetect/astro.vim b/ftdetect/astro.vim index 577c2e5..01bae18 100644 --- a/ftdetect/astro.vim +++ b/ftdetect/astro.vim @@ -1,12 +1,16 @@ " Vim ftdetect file. " Language: Astro " Author: Wuelner Martínez +" Maintainer: Wuelner Martínez " 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 DetectFiletypeAstro() +" vim: ts=8 diff --git a/indent/astro.vim b/indent/astro.vim index 5bb0aa2..4ed810d 100644 --- a/indent/astro.vim +++ b/indent/astro.vim @@ -1,8 +1,9 @@ " Vim indent file (experimental). " Language: Astro " Author: Wuelner Martínez +" Maintainer: Wuelner Martínez " 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 diff --git a/syntax/astro.vim b/syntax/astro.vim index 88d127d..0816051 100644 --- a/syntax/astro.vim +++ b/syntax/astro.vim @@ -1,8 +1,9 @@ " Vim syntax file. " Language: Astro " Author: Wuelner Martínez +" Maintainer: Wuelner Martínez " 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.