aboutsummaryrefslogtreecommitdiff
path: root/vim/indent
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-07 13:23:45 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-07 13:23:45 +1200
commit056b6f78ae688f9e78fa78dad467a58af378e5a9 (patch)
tree1d87c07c04567bbf70139094c39cefb060fbff7a /vim/indent
parentFurther extension of Perl Vim line cont rules (diff)
downloaddotfiles-056b6f78ae688f9e78fa78dad467a58af378e5a9.tar.gz
dotfiles-056b6f78ae688f9e78fa78dad467a58af378e5a9.zip
Pass Vim indent line into Perl function
Should make testing (!) easier later on.
Diffstat (limited to 'vim/indent')
-rw-r--r--vim/indent/perl.vim8
1 files 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)