annotate runtime/ftplugin/basic.vim @ 28403:2655935b5ccc v8.2.4726

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