aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/perl.vim
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-12-03 16:49:30 +0300
committerZyX <kp-pav@yandex.ru>2017-12-03 16:49:30 +0300
commitc49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57 (patch)
treeb7e59c416d1435725c65f8952b6e55c70544d97e /runtime/indent/perl.vim
parent62108c3b0be46936c83f6d4c98b44ceb5e6f77fd (diff)
parent27a577586eace687c47e7398845178208cae524a (diff)
downloadrneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.tar.gz
rneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.tar.bz2
rneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.zip
Merge branch 'master' into s-dash-stdin
Diffstat (limited to 'runtime/indent/perl.vim')
-rw-r--r--runtime/indent/perl.vim23
1 files changed, 10 insertions, 13 deletions
diff --git a/runtime/indent/perl.vim b/runtime/indent/perl.vim
index fc4b6a30d3..094d1d37ea 100644
--- a/runtime/indent/perl.vim
+++ b/runtime/indent/perl.vim
@@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
-" Last Change: 2013-07-24
+" Last Change: 2017-01-04
" Suggestions and improvements by :
" Aaron J. Sherman (use syntax for hints)
@@ -48,11 +48,6 @@ function! GetPerlIndent()
return 0
endif
- " Don't reindent comments on first column
- if cline =~ '^#.'
- return 0
- endif
-
" Get current syntax item at the line's first char
let csynid = ''
if b:indent_use_syntax
@@ -134,13 +129,14 @@ function! GetPerlIndent()
\ || synid == "perlMatchStartEnd"
\ || synid == "perlHereDoc"
\ || synid == "perlBraces"
+ \ || synid == "perlStatementIndirObj"
\ || synid =~ "^perlFiledescStatement"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let brace = strpart(line, bracepos, 1)
if brace == '(' || brace == '{' || brace == '['
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
else
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
endif
let bracepos = match(line, braceclass, bracepos + 1)
@@ -151,26 +147,27 @@ function! GetPerlIndent()
if synid == ""
\ || synid == "perlMatchStartEnd"
\ || synid == "perlBraces"
+ \ || synid == "perlStatementIndirObj"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
endif
else
if line =~ '[{[(]\s*\(#[^])}]*\)\=$'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if cline =~ '^\s*[])}]'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
endif
" Indent lines that begin with 'or' or 'and'
if cline =~ '^\s*\(or\|and\)\>'
if line !~ '^\s*\(or\|and\)\>'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
elseif line =~ '^\s*\(or\|and\)\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind