From ad6bb386be30ee50ef2e61268597241e0ddb842b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 2 May 2021 12:55:08 -0400 Subject: vim-patch:4c295027a426 Update runtime files https://github.com/vim/vim/commit/4c295027a426986566cd7a76c47a6d3a529727e7 --- runtime/ftplugin/pascal.vim | 52 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'runtime/ftplugin/pascal.vim') diff --git a/runtime/ftplugin/pascal.vim b/runtime/ftplugin/pascal.vim index 5ff18b9601..2de92563ae 100644 --- a/runtime/ftplugin/pascal.vim +++ b/runtime/ftplugin/pascal.vim @@ -1,20 +1,50 @@ " Vim filetype plugin file -" Language: pascal -" Maintainer: Dan Sharp -" Last Changed: 11 Apr 2011 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: Pascal +" Maintainer: Doug Kearns +" Previous Maintainer: Dan Sharp +" Last Change: 2021 Apr 23 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + +set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:} +set commentstring={%s} + +if exists("pascal_delphi") + set comments+=:/// +endif + +if !exists("pascal_traditional") + set commentstring=//\ %s + set comments+=:// +endif + +setlocal formatoptions-=t formatoptions+=croql + if exists("loaded_matchit") - let b:match_ignorecase = 1 " (pascal is case-insensitive) + let b:match_ignorecase = 1 " (Pascal is case-insensitive) + + let b:match_words = '\<\%(asm\|begin\|case\|\%(\%(=\|packed\)\s*\)\@<=\%(class\|object\)\|\%(=\s*\)\@<=interface\|record\|try\)\>' + let b:match_words .= ':\%(^\s*\)\@<=\%(except\|finally\|else\|otherwise\)\>' + let b:match_words .= ':\\.\@!' + + let b:match_words .= ',\:\' + " let b:match_words .= ',\:\' " FIXME - else clashing with middle else. It seems like a debatable use anyway. + let b:match_words .= ',\:\<\%(\%(^\s*\)\@<=interface\|implementation\|initialization\|finalization\)\>:\