aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-07 14:17:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-07 14:17:26 +1200
commit4d3ec71335a338a5362a073099e6039d72fef416 (patch)
tree1aeac96cc01fe254329eb8bd10e9c1c65e72a366
parent6bbeb03e06a538825f038d87d9c5548fe3546c6c (diff)
downloaddotfiles-4d3ec71335a338a5362a073099e6039d72fef416.tar.gz
dotfiles-4d3ec71335a338a5362a073099e6039d72fef416.zip
Simplify POD Vim indenting behaviour
-rw-r--r--vim/indent/perl.vim12
1 files changed, 6 insertions, 6 deletions
diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim
index 68ee8d34..d03735a4 100644
--- a/vim/indent/perl.vim
+++ b/vim/indent/perl.vim
@@ -77,6 +77,11 @@ function! GetPerlIndent(lnum)
return 0
endif
+ " If we're in POD, just autoindent; simple and good enough.
+ if l:pod
+ return indent(a:lnum - 1)
+ endif
+
" Get data of previous non-blank and non-heredoc line
let l:pl = getline(l:pn)
let l:pi = indent(l:pn)
@@ -84,13 +89,8 @@ function! GetPerlIndent(lnum)
" Get value of 'shiftwidth'
let l:sw = exists('*shiftwidth')
\ ? shiftwidth()
- \ : &shiftwidth
+ \ : &shiftwidth || &tabstop
- " If we're in POD and the indent of the previous line was less than
- " 'shiftwith', keep it there.
- if l:pod && l:pi < l:sw
- return l:pi
- endif
" Get current line properties
let l:cl = getline(a:lnum)