Mercurial > vim
comparison runtime/indent/perl.vim @ 12499:d91cf2e26ef0
Update runtime files.
commit https://github.com/vim/vim/commit/37c64c78fd87e086b5a945ad7032787c274e2dcb
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 19 22:06:03 2017 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Sep 2017 22:15:06 +0200 |
parents | 63b0b7b79b25 |
children | bd021eb62e73 |
comparison
equal
deleted
inserted
replaced
12498:bf98d339b568 | 12499:d91cf2e26ef0 |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: Perl 5 | 2 " Language: Perl 5 |
3 " Maintainer: vim-perl <vim-perl@googlegroups.com> | 3 " Maintainer: vim-perl <vim-perl@googlegroups.com> |
4 " Homepage: http://github.com/vim-perl/vim-perl | 4 " Homepage: http://github.com/vim-perl/vim-perl |
5 " Bugs/requests: http://github.com/vim-perl/vim-perl/issues | 5 " Bugs/requests: http://github.com/vim-perl/vim-perl/issues |
6 " Last Change: 2017 Jun 13 | 6 " Last Change: 2017-01-04 |
7 | 7 |
8 " Suggestions and improvements by : | 8 " Suggestions and improvements by : |
9 " Aaron J. Sherman (use syntax for hints) | 9 " Aaron J. Sherman (use syntax for hints) |
10 " Artem Chuprina (play nice with folding) | 10 " Artem Chuprina (play nice with folding) |
11 | 11 |
43 " Get the line to be indented | 43 " Get the line to be indented |
44 let cline = getline(v:lnum) | 44 let cline = getline(v:lnum) |
45 | 45 |
46 " Indent POD markers to column 0 | 46 " Indent POD markers to column 0 |
47 if cline =~ '^\s*=\L\@!' | 47 if cline =~ '^\s*=\L\@!' |
48 return 0 | |
49 endif | |
50 | |
51 " Don't reindent comments on first column | |
52 if cline =~ '^#.' | |
53 return 0 | 48 return 0 |
54 endif | 49 endif |
55 | 50 |
56 " Get current syntax item at the line's first char | 51 " Get current syntax item at the line's first char |
57 let csynid = '' | 52 let csynid = '' |
132 " 'perlHereDoc' is here only to handle the case '&foo(<<EOF)'. | 127 " 'perlHereDoc' is here only to handle the case '&foo(<<EOF)'. |
133 if synid == "" | 128 if synid == "" |
134 \ || synid == "perlMatchStartEnd" | 129 \ || synid == "perlMatchStartEnd" |
135 \ || synid == "perlHereDoc" | 130 \ || synid == "perlHereDoc" |
136 \ || synid == "perlBraces" | 131 \ || synid == "perlBraces" |
132 \ || synid == "perlStatementIndirObj" | |
137 \ || synid =~ "^perlFiledescStatement" | 133 \ || synid =~ "^perlFiledescStatement" |
138 \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' | 134 \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' |
139 let brace = strpart(line, bracepos, 1) | 135 let brace = strpart(line, bracepos, 1) |
140 if brace == '(' || brace == '{' || brace == '[' | 136 if brace == '(' || brace == '{' || brace == '[' |
141 let ind = ind + shiftwidth() | 137 let ind = ind + shiftwidth() |
149 if bracepos != -1 | 145 if bracepos != -1 |
150 let synid = synIDattr(synID(v:lnum, bracepos, 0), "name") | 146 let synid = synIDattr(synID(v:lnum, bracepos, 0), "name") |
151 if synid == "" | 147 if synid == "" |
152 \ || synid == "perlMatchStartEnd" | 148 \ || synid == "perlMatchStartEnd" |
153 \ || synid == "perlBraces" | 149 \ || synid == "perlBraces" |
150 \ || synid == "perlStatementIndirObj" | |
154 \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' | 151 \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' |
155 let ind = ind - shiftwidth() | 152 let ind = ind - shiftwidth() |
156 endif | 153 endif |
157 endif | 154 endif |
158 else | 155 else |