From 79b92da0d289d1adcd0bb27c7ee5786be460c166 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 31 Jan 2022 15:27:01 +0100 Subject: vim-patch:partial:f10911e5db16 (#17248) Update runtime files https://github.com/vim/vim/commit/f10911e5db16f1fe6ab519c5d091ad0c1df0d063 --- runtime/ftplugin/freebasic.vim | 60 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'runtime/ftplugin/freebasic.vim') diff --git a/runtime/ftplugin/freebasic.vim b/runtime/ftplugin/freebasic.vim index a2bb459f20..58c2b4c9e2 100644 --- a/runtime/ftplugin/freebasic.vim +++ b/runtime/ftplugin/freebasic.vim @@ -1,13 +1,65 @@ " Vim filetype plugin file -" Language: FreeBasic +" Language: FreeBASIC " Maintainer: Doug Kearns -" Last Change: 2015 Jan 10 +" Last Change: 2021 Mar 16 +" Setup {{{1 if exists("b:did_ftplugin") finish endif -let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim runtime! ftplugin/basic.vim -" vim: ts=8 +let s:dialect = freebasic#GetDialect() + +" Comments {{{1 +" add ''comments before 'comments +let &l:comments = "sO:*\ -,mO:*\ \ ,exO:*/,s1:/',mb:',ex:'/,:''," .. &l:comments + +" Match words {{{1 +if exists("loaded_matchit") + let s:not_end = '\%(end\s\+\)\@:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\,' + endif + + if s:dialect == 'fb' || s:dialect == 'deprecated' + let b:match_words ..= s:not_end .. '\:\,' + endif + + if s:dialect == 'qb' + let b:match_words ..= s:not_end .. '\<__asm\>:\,' .. + \ s:not_end .. '\<__union\>:\,' .. + \ s:not_end .. '\<__with\>:\,' + else + let b:match_words ..= s:not_end .. '\:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\:\,' + endif + + let b:match_words ..= s:not_end .. '\:\,' .. + \ '^#\s*\%(if\|ifdef\|ifndef\)\>:^#\s*\%(else\|elseif\)\>:^#\s*endif\>,' .. + \ '^#\s*macro\>:^#\s*endmacro\>' + + " skip "function = " + let b:match_skip ..= '|| strpart(getline("."), col(".") - 1) =~? "^\\