From 2560f9a91ccc3c269851fb25100f0836a1dbcb67 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 27 Aug 2018 17:29:24 +1200 Subject: Convert a few stridx() to alternative forms If we don't actually want to know whether the string occurs *anywhere* in the line, just at the start, we should really use substring operations or plain old regular expression tests. --- vim/scripts.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vim/scripts.vim') diff --git a/vim/scripts.vim b/vim/scripts.vim index ae792ada..f79fa74c 100644 --- a/vim/scripts.vim +++ b/vim/scripts.vim @@ -6,7 +6,7 @@ let s:line = getline(1) " If it's not a shebang, we're done -if stridx(s:line, '#!') != 0 +if s:line !~# '^#!' finish endif -- cgit v1.2.3