From b77c5f11070ecb2ff343aa18b4ea859e6168f16c Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 17 Feb 2022 04:31:35 +0100 Subject: Update --- ftplugin/basic.vim | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'ftplugin/basic.vim') diff --git a/ftplugin/basic.vim b/ftplugin/basic.vim index 016253f6..1702fbd6 100644 --- a/ftplugin/basic.vim +++ b/ftplugin/basic.vim @@ -3,9 +3,9 @@ if polyglot#init#is_disabled(expand(':p'), 'basic', 'ftplugin/basic.vim') endif " Vim filetype plugin file -" Language: BASIC +" Language: BASIC (QuickBASIC 4.5) " Maintainer: Doug Kearns -" Last Change: 2015 Jan 10 +" Last Change: 2021 Mar 16 if exists("b:did_ftplugin") finish @@ -15,17 +15,46 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -setlocal comments=:REM,:' +setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:' setlocal commentstring='\ %s setlocal formatoptions-=t formatoptions+=croql +" TODO: support exit ... as middle matches? +if exists("loaded_matchit") && !exists("b:match_words") + let s:line_start = '\%(^\s*\)\@<=' + let s:not_end = '\%(end\s\+\)\@,' .. + \ s:not_end_or_exit .. '\:\,' .. + \ s:not_end_or_exit .. '\:\,' .. + \ s:not_end .. '\:\,' .. + \ s:not_end .. '\:\%(select\s\+\)\@:\,' .. + \ '\:\,' .. + \ '\\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\,' .. + \ '\:\,' .. + \ s:line_start .. 'if\%(.*\:\,' .. + \ '\:\' + + let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' .. + \ 'strpart(getline("."), 0, col(".") ) =~? "\\