annotate runtime/indent/framescript.vim @ 17867:180fb9981255 v8.1.1930

patch 8.1.1930: cannot recognize .jsx and .tsx files Commit: https://github.com/vim/vim/commit/92852cee3fcff1dc6ce12387b234634e73267b22 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 26 21:28:15 2019 +0200 patch 8.1.1930: cannot recognize .jsx and .tsx files Problem: Cannot recognize .jsx and .tsx files. Solution: Recognize them as javascriptreact and typescriptreact. (closes #4830)
author Bram Moolenaar <Bram@vim.org>
date Mon, 26 Aug 2019 21: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