annotate runtime/indent/framescript.vim @ 26427:549cd187f215

Added tag v8.2.3744 for changeset c59d60e21ef5c5e92f1048412534124e0cd79efb
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Dec 2021 14:30:03 +0100
parents 9c221ad9634a
children
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
25880
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
2 " Language: FrameScript
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
5 " Last Change: 24 Sep 2021
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
6
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
7 if exists("b:did_indent")
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
8 finish
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
9 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
10 let b:did_indent = 1
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
11
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
12 setlocal indentexpr=GetFrameScriptIndent()
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
13 setlocal indentkeys=!^F,o,O,0=~Else,0=~EndIf,0=~EndLoop,0=~EndSub
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
14 setlocal nosmartindent
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
15
25880
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
16 let b:undo_indent = "setl inde< indk< si<"
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11160
diff changeset
17
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
18 if exists("*GetFrameScriptIndent")
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
19 finish
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
20 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
21
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
22 function GetFrameScriptIndent()
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
23 let lnum = prevnonblank(v:lnum - 1)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
24
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
25 if lnum == 0
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
26 return 0
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
27 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
28
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
29 if getline(v:lnum) =~ '^\s*\*'
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
30 return cindent(v:lnum)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
31 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
32
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
33 let ind = indent(lnum)
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
34
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
35 if getline(lnum) =~? '^\s*\%(If\|Loop\|Sub\)'
11160
d0a20101ecb2 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
36 let ind = ind + shiftwidth()
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
37 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
38
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
39 if getline(v:lnum) =~? '^\s*\%(Else\|End\%(If\|Loop\|Sub\)\)'
11160
d0a20101ecb2 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
40 let ind = ind - shiftwidth()
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
41 endif
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
42
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
43 return ind
f4f8014d516e updated for version 7.2c-000
vimboss
parents:
diff changeset
44 endfunction