Mercurial > vim
view runtime/syntax/typescript.vim @ 34387:e6defaa1e46a v9.1.0120
patch 9.1.0120: hard to get visual region using Vim script
Commit: https://github.com/vim/vim/commit/3f905ab3c4f66562f4a224bf00f49d98a0b0da91
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Wed Feb 21 00:02:45 2024 +0100
patch 9.1.0120: hard to get visual region using Vim script
Problem: hard to get visual region using Vim script
Solution: Add getregion() Vim script function
(Shougo Matsushita, Jakub ?uczy?ski)
closes: #13998
closes: #11579
Co-authored-by: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= <doubleloop@o2.pl>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 21 Feb 2024 00:15:02 +0100 |
parents | 71cbad0921c9 |
children | 5ea191f0c8a1 |
line wrap: on
line source
" Vim syntax file " Language: TypeScript " Maintainer: Herrington Darkholme " Last Change: 2023 Aug 13 " Based On: Herrington Darkholme's yats.vim " Changes: Go to https://github.com/HerringtonDarkholme/yats.vim for recent changes. " Origin: https://github.com/othree/yajs " Credits: Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck " (This file is based on their hard work), gumnos (From the #vim " IRC Channel in Freenode) " This is the same syntax that is in yats.vim, but: " - flattened into one file " - HiLink commands changed to "hi def link" " - Setting 'cpo' to the Vim value if !exists("main_syntax") if exists("b:current_syntax") finish endif let main_syntax = 'typescript' endif let s:cpo_save = &cpo set cpo&vim " this region is NOT used in TypeScriptReact " nextgroup doesn't contain objectLiteral, let outer region contains it syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets \ start=/< \@!/ end=/>/ \ contains=@typescriptType \ nextgroup=@typescriptExpression \ contained skipwhite oneline """"""""""""""""""""""""""""""""""""""""""""""""""" " Source the part common with typescriptreact.vim source <sfile>:h/shared/typescriptcommon.vim let b:current_syntax = "typescript" if main_syntax == 'typescript' unlet main_syntax endif let &cpo = s:cpo_save unlet s:cpo_save