annotate runtime/indent/readline.vim @ 10091:9e5e3392f9b6

Added tag v7.4.2316 for changeset 68303019acc994c41e623b6be3235f7342f2be67
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Sep 2016 19:00:06 +0200
parents 5eb1ac6f92ad
children 1218c5353e2b
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 indent file
1228
5eb1ac6f92ad updated for version 7.1b
vimboss
parents: 856
diff changeset
2 " Language: readline configuration file
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 375
diff changeset
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
1228
5eb1ac6f92ad updated for version 7.1b
vimboss
parents: 856
diff changeset
4 " Latest Revision: 2006-12-20
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("b:did_indent")
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 b:did_indent = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 setlocal indentexpr=GetReadlineIndent()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 setlocal indentkeys=!^F,o,O,=$else,=$endif
1228
5eb1ac6f92ad updated for version 7.1b
vimboss
parents: 856
diff changeset
13 setlocal nosmartindent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 if exists("*GetReadlineIndent")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 function GetReadlineIndent()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 let lnum = prevnonblank(v:lnum - 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 if lnum == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 let ind = indent(lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
27 if getline(lnum) =~ '^\s*$\(if\|else\)\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 let ind = ind + &sw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
31 if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 let ind = ind - &sw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 return ind
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 endfunction