From 4d3ec71335a338a5362a073099e6039d72fef416 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 14:17:26 +1200 Subject: Simplify POD Vim indenting behaviour --- vim/indent/perl.vim | 12 ++++++------ 1 file 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) -- cgit v1.2.3