try not to mess with buffers that are regular files (eg: netrw) vim-stuff
authormiguel
Wed, 12 Sep 2012 01:48:30 +0100
branchvim-stuff
changeset 25 efe9199dbd41
parent 24 38db5185d698
child 26 e3edddb48a91
try not to mess with buffers that are regular files (eg: netrw)
hgrev/plugin/hgrev.vim
--- a/hgrev/plugin/hgrev.vim	Mon Aug 20 16:14:43 2012 -0700
+++ b/hgrev/plugin/hgrev.vim	Wed Sep 12 01:48:30 2012 +0100
@@ -70,6 +70,13 @@
 	" Find the closest HG root for the buffer. 'hg root' won't do it, since
 	" it works off the cwd, and we need the nearest root from the filename.
 	"
+
+	if matchstr(bufname('%'), "^[^:/]\\+://") != ''
+		" not on this buffer...
+		" (we're unlikely to get lucky finding '.hg' in http:// or similar)
+		return
+	endif
+
 	let l:searchpaths = split( expand('%:p:h'), '/' )
 	let l:dircount = len(l:searchpaths)
 	let l:root = ''