annotate runtime/indent.vim @ 9262:c9f2b70feac0 v7.4.1914

commit https://github.com/vim/vim/commit/e429e70f050cb2941f1f8427cf918b68444c904e Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 10 19:49:14 2016 +0200 patch 7.4.1914 Problem: Executing autocommands while using the signal stack has a high chance of crashing Vim. Solution: Don't invoke autocommands when on the signal stack.
author Christian Brabandt <cb@256bit.org>
date Fri, 10 Jun 2016 20:00:07 +0200
parents 19ef2bbf569c
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 indent files 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>
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
4 " Last Change: 2008 Feb 22
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_indent_on")
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_indent_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 augroup filetypeindent
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
12 au FileType * call s:LoadIndent()
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
13 func! s:LoadIndent()
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
14 if exists("b:undo_indent")
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
15 exe b:undo_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
16 unlet! b:undo_indent b:did_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
17 endif
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
18 let s = expand("<amatch>")
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
19 if s != ""
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
20 if exists("b:did_indent")
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
21 unlet b:did_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
22 endif
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
23
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
24 " When there is a dot it is used to separate filetype names. Thus for
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
25 " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
26 for name in split(s, '\.')
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
27 exe 'runtime! indent/' . name . '.vim'
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
28 endfor
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
29 endif
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
30 endfunc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 augroup END