comparison runtime/ftplugin/basic.vim @ 27459:5825405e4e2c

Update runtime files Commit: https://github.com/vim/vim/commit/f10911e5db16f1fe6ab519c5d091ad0c1df0d063 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 29 22:20:48 2022 +0000 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jan 2022 23:30:04 +0100
parents 34b4eb3a8458
children 912224cab37f
comparison
equal deleted inserted replaced
27458:2a7fc102cb91 27459:5825405e4e2c
1 " Vim filetype plugin file 1 " Vim filetype plugin file
2 " Language: BASIC 2 " Language: BASIC (QuickBASIC 4.5)
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> 3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
4 " Last Change: 2015 Jan 10 4 " Last Change: 2021 Mar 16
5 5
6 if exists("b:did_ftplugin") 6 if exists("b:did_ftplugin")
7 finish 7 finish
8 endif 8 endif
9 let b:did_ftplugin = 1 9 let b:did_ftplugin = 1
10 10
11 let s:cpo_save = &cpo 11 let s:cpo_save = &cpo
12 set cpo&vim 12 set cpo&vim
13 13
14 setlocal comments=:REM,:' 14 setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:'
15 setlocal commentstring='\ %s 15 setlocal commentstring='\ %s
16 setlocal formatoptions-=t formatoptions+=croql 16 setlocal formatoptions-=t formatoptions+=croql
17 17
18 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 18 " TODO: support exit ... as middle matches?
19 let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" . 19 if exists("loaded_matchit") && !exists("b:match_words")
20 \ "All Files (*.*)\t*.*\n" 20 let s:line_start = '\%(^\s*\)\@<='
21 let s:not_end = '\%(end\s\+\)\@<!'
22 let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!'
23
24 let b:match_ignorecase = 1
25 let b:match_words =
26 \ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' ..
27 \ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' ..
28 \ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' ..
29 \ s:not_end .. '\<type\>:\<end\s\+type\>,' ..
30 \ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..
31 \ '\<do\>:\<loop\>,' ..
32 \ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' ..
33 \ '\<while\>:\<wend\>,' ..
34 \ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' ..
35 \ '\<lock\>:\<unlock\>'
36
37 let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' ..
38 \ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"'
39
40 unlet s:line_start s:not_end s:not_end_or_exit
21 endif 41 endif
22 42
23 let b:undo_ftplugin = "setl fo< com< cms< sua<" . 43 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
24 \ " | unlet! b:browsefilter" 44 let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..
45 \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" ..
46 \ "All Files (*.*)\t*.*\n"
47 endif
48
49 let b:undo_ftplugin = "setl fo< com< cms<" ..
50 \ " | unlet! b:match_ignorecase b:match_skip b:match_words" ..
51 \ " | unlet! b:browsefilter"
25 52
26 let &cpo = s:cpo_save 53 let &cpo = s:cpo_save
27 unlet s:cpo_save 54 unlet s:cpo_save
55
56 " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: