From 056b6f78ae688f9e78fa78dad467a58af378e5a9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 13:23:45 +1200 Subject: Pass Vim indent line into Perl function Should make testing (!) easier later on. --- vim/indent/perl.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim index c9cfe829..ee8fbd68 100644 --- a/vim/indent/perl.vim +++ b/vim/indent/perl.vim @@ -27,17 +27,17 @@ let s:heredoc_open = '<<\~\?' \ . '.*;\s*$' " Define indent function -function! GetPerlIndent() +function! GetPerlIndent(lnum) " Get previous line, bail if none - let l:pn = prevnonblank(v:lnum - 1) + let l:pn = prevnonblank(a:lnum - 1) if !l:pn return 0 endif " Heredoc detection; start at top of buffer let l:hn = 0 - while l:hn < v:lnum + while l:hn < a:lnum let l:hl = getline(l:hn) " If we're not in a heredoc and not in a comment ... @@ -68,7 +68,7 @@ function! GetPerlIndent() endif " Get current line properties - let l:cl = getline(v:lnum) + let l:cl = getline(v:anum) " Get data of previous non-blank and non-heredoc line let l:pl = getline(l:pn) -- cgit v1.2.3