diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 13:23:45 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 13:23:45 +1200 |
commit | 056b6f78ae688f9e78fa78dad467a58af378e5a9 (patch) | |
tree | 1d87c07c04567bbf70139094c39cefb060fbff7a /vim/indent | |
parent | Further extension of Perl Vim line cont rules (diff) | |
download | dotfiles-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.vim | 8 |
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) |