From 579cf9aba14bcf67b4237470104dafc64af9054a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 01:10:14 +1200 Subject: Adjust a few Vim Perl indent comments --- vim/indent/perl.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim index edb91028..43137e9c 100644 --- a/vim/indent/perl.vim +++ b/vim/indent/perl.vim @@ -9,7 +9,7 @@ let b:did_indent = 1 " Define indent function function! GetPerlIndent() - " Just return 0 if we have no previous line to work from + " Get previous line, bail if none let l:pn = prevnonblank(v:lnum - 1) if !l:pn return 0 @@ -26,7 +26,7 @@ function! GetPerlIndent() \ ? shiftwidth() \ : &shiftwidth - " Don't touch comments + " Just follow comment indent if l:pl =~# '^\s*#' return l:pi @@ -42,7 +42,7 @@ function! GetPerlIndent() return l:pi + l:sw endif - " Closing brace + " Entering closing brace elseif l:cl =~# '^\s*[])}]' " Reduce indent if possible @@ -56,7 +56,7 @@ function! GetPerlIndent() elseif l:pl =~# '[;,}]\s*$' return l:pi - (l:pi % l:sw) - " Continued line; add half shiftwidth + " Continued line; add half 'shiftwidth' elseif l:sw >= 2 return l:pi + l:sw / 2 endif @@ -67,7 +67,7 @@ endfunction setlocal indentexpr=GetPerlIndent() setlocal indentkeys+=0},0),0] -" Undo all of the above crap +" How to undo all of that let b:undo_indent = '|setlocal indentexpr<' \ . '|setlocal indentkeys<' \ . '|delfunction GetPerlIndent' -- cgit v1.2.3