annotate runtime/indent/framescript.vim @ 20799:a3f74832de9b

Added tag v8.2.0951 for changeset ce36225c9bed639c75fb52b5a58a5c9cfbcf146c
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Jun 2020 20:30:04 +0200
parents d0a20101ecb2
children 9c221ad9634a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
1 " Vim indent file
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
2 " Language: FrameScript
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
4 " Latest Revision: 2008-07-19
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
5
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
6 if exists("b:did_indent")
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
7 finish
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
8 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
9 let b:did_indent = 1
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
10
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
11 setlocal indentexpr=GetFrameScriptIndent()
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
12 setlocal indentkeys=!^F,o,O,0=~Else,0=~EndIf,0=~EndLoop,0=~EndSub
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
13 setlocal nosmartindent
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
14
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
15 if exists("*GetFrameScriptIndent")
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
16 finish
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
17 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
18
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
19 function GetFrameScriptIndent()
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
20 let lnum = prevnonblank(v:lnum - 1)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
21
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
22 if lnum == 0
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
23 return 0
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
24 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
25
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
26 if getline(v:lnum) =~ '^\s*\*'
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
27 return cindent(v:lnum)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
28 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
29
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
30 let ind = indent(lnum)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
31
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
32 if getline(lnum) =~? '^\s*\%(If\|Loop\|Sub\)'
11160
d0a20101ecb2 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
33 let ind = ind + shiftwidth()
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
34 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
35
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
36 if getline(v:lnum) =~? '^\s*\%(Else\|End\%(If\|Loop\|Sub\)\)'
11160
d0a20101ecb2 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
37 let ind = ind - shiftwidth()
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
38 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
39
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
40 return ind
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
41 endfunction