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/fpcmake.vim | 25 +++++++++++++++++++++ runtime/ftplugin/pascal.vim | 52 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 66 insertions(+), 11 deletions(-) create mode 100644 runtime/ftplugin/fpcmake.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/fpcmake.vim b/runtime/ftplugin/fpcmake.vim new file mode 100644 index 0000000000..8d950838c7 --- /dev/null +++ b/runtime/ftplugin/fpcmake.vim @@ -0,0 +1,25 @@ +" Vim filetype plugin file +" Language: Free Pascal Makefile Generator +" Maintainer: Doug Kearns +" Last Change: 2021 Apr 23 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +runtime! ftplugin/make.vim + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Free Pascal Makefile Definition Files (*.fpc)\t*.fpc\n" .. + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = b:undo_ftplugin .. " | unlet! b:browsefilter" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet: 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\)\>:\