From 69bc9842212f3404499c4f18202dbd1de9efd34a Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 29 May 2012 22:14:42 -0400 Subject: [PATCH] vim: move the function-once test before stuffs This remove the error in vim about existing functions when a second nit file is loaded. Signed-off-by: Jean Privat --- misc/vim/indent/nit.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/vim/indent/nit.vim b/misc/vim/indent/nit.vim index 51c1d53..afaa93a 100644 --- a/misc/vim/indent/nit.vim +++ b/misc/vim/indent/nit.vim @@ -33,6 +33,11 @@ setlocal comments=:# setlocal indentkeys+==end,=else,=do,=var,0!,=then,=loop,=special,=class,=interface,=universal setlocal sw=8 +" Only define the function once. +if exists("*GetNITIndent") + finish +endif + " Indent after let s:relative_indent = '\<\(do\|loop\|then\|else\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\\s*\)\?\<\(class\|interface\|universal\|special\)\>' " Unindent on them @@ -52,11 +57,6 @@ function s:Match(lnum, regex) return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 endfunction -" Only define the function once. -if exists("*GetNITIndent") - finish -endif - function GetNITIndent() " Find a non-blank line above the current line. let plnum = prevnonblank(v:lnum - 1) -- 1.7.9.5