annotate runtime/indent/framescript.vim @ 19894:ea4f8e789627 v8.2.0503

patch 8.2.0503: Vim9: some code is not tested Commit: https://github.com/vim/vim/commit/585fea7b98b79f2c6d92fa8a2340e461aff805c8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 2 22:33:21 2020 +0200 patch 8.2.0503: Vim9: some code is not tested Problem: Vim9: some code is not tested. Solution: Add tests. Fix uncovered problems.
author Bram Moolenaar <Bram@vim.org>
date Thu, 02 Apr 2020 22:45: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