annotate runtime/ftplugin.vim @ 24124:f4061617c438 v8.2.2603

patch 8.2.2603: Vim9: no effect if user command is also a function Commit: https://github.com/vim/vim/commit/77b10ffad4ebad15022614be4db2745f6a90f405 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 14 13:21:35 2021 +0100 patch 8.2.2603: Vim9: no effect if user command is also a function Problem: Vim9: no effect if user command is also a function. Solution: Check for paren following. (closes https://github.com/vim/vim/issues/7960)
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Mar 2021 13:30:03 +0100
parents 8cd729851562
children f37561549ec2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim support file to switch on loading plugins for file types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
4 " Last change: 2006 Apr 30
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 if exists("did_load_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let did_load_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 augroup filetypeplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 au FileType * call s:LoadFTPlugin()
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
13
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 func! s:LoadFTPlugin()
230
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
15 if exists("b:undo_ftplugin")
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
16 exe b:undo_ftplugin
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
17 unlet! b:undo_ftplugin b:did_ftplugin
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
18 endif
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
19
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
20 let s = expand("<amatch>")
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
21 if s != ""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if &cpo =~# "S" && exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " In compatible mode options are reset to the global values, need to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " set the local values also when a plugin was already used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 unlet b:did_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
27
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
28 " When there is a dot it is used to separate filetype names. Thus for
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
29 " "aaa.bbb" load "aaa" and then "bbb".
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
30 for name in split(s, '\.')
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
31 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
32 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endfunc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 augroup END