view runtime/syntax/pbtxt.vim @ 27726:d3ed8b1a7bde v8.2.4389

patch 8.2.4389: screenpos() does not handle a position in a closed fold Commit: https://github.com/vim/vim/commit/4556a2e8681c5c98fb4c7ca0a016924a69b4452a Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 15 13:40:17 2022 +0000 patch 8.2.4389: screenpos() does not handle a position in a closed fold Problem: screenpos() does not handle a position in a closed fold. Solution: Check if the position is inside a closed fold. (closes https://github.com/vim/vim/issues/9778)
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Feb 2022 14:45:03 +0100
parents e7c125224b1a
children
line wrap: on
line source

" Vim syntax file
" Language:             Protobuf Text Format
" Maintainer:           Lakshay Garg <lakshayg@outlook.in>
" Last Change:          2020 Nov 17
" Homepage:             https://github.com/lakshayg/vim-pbtxt

if exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn case ignore

syn keyword pbtxtTodo     TODO FIXME contained
syn keyword pbtxtBool     true false contained

syn match   pbtxtInt      display   "\<\(0\|[1-9]\d*\)\>"
syn match   pbtxtHex      display   "\<0[xX]\x\+\>"
syn match   pbtxtFloat    display   "\(0\|[1-9]\d*\)\=\.\d*"
syn match   pbtxtMessage  display   "^\s*\w\+\s*{"me=e-1
syn match   pbtxtField    display   "^\s*\w\+:"me=e-1
syn match   pbtxtEnum     display   ":\s*\a\w\+"ms=s+1   contains=pbtxtBool
syn region  pbtxtString   start=+"+ skip=+\\"+ end=+"+   contains=@Spell
syn region  pbtxtComment  start="#" end="$"      keepend contains=pbtxtTodo,@Spell

hi def link pbtxtTodo     Todo
hi def link pbtxtBool     Boolean
hi def link pbtxtInt      Number
hi def link pbtxtHex      Number
hi def link pbtxtFloat    Float
hi def link pbtxtMessage  Structure
hi def link pbtxtField    Identifier
hi def link pbtxtEnum     Define
hi def link pbtxtString   String
hi def link pbtxtComment  Comment

let b:current_syntax = "pbtxt"

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: nowrap sw=2 sts=2 ts=8 noet