From 3fb703f0a7d09966aebfbf345e16936348e353ec Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 23 Aug 2013 10:29:52 +0430 Subject: [PATCH] forgot to add utils --- test/utils.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/utils.vim diff --git a/test/utils.vim b/test/utils.vim new file mode 100644 index 0000000..2f2d823 --- /dev/null +++ b/test/utils.vim @@ -0,0 +1,11 @@ +function! g:current_buffer_is_module(module_name) + return g:ends_with(bufname('%'), a:module_name.'.py') +endfunction + + +function g:ends_with(string, end) + let l:should = len(a:string) - strlen(a:end) + return l:should == stridx(a:string, a:end, should) +endfunction + +" vim: et:ts=4:sw=4