Fix key lookup when a repo is found, but the file under edit isn't a part of it. vim-stuff tip
authorMahlon E. Smith <mahlon@martini.nu>
Wed, 18 Oct 2017 10:54:16 -0700
branchvim-stuff
changeset 30 92095e6c3cf6
parent 29 dda9eb90cf5d
Fix key lookup when a repo is found, but the file under edit isn't a part of it.
plugin/hgrev.vim
--- a/plugin/hgrev.vim	Sat Jan 16 11:36:34 2016 -0800
+++ b/plugin/hgrev.vim	Wed Oct 18 10:54:16 2017 -0700
@@ -100,11 +100,13 @@
 	let l:rev     = system( l:cmd )
 	let l:hg_exit = v:shell_error
 
-	if l:hg_exit == 0
-		let l:rev = substitute( l:rev, '\n', '', 'g' )
-		let g:hg_revs[ l:key ] = l:rev
+	if l:hg_exit != 0
+		return
 	endif
 
+	let l:rev = substitute( l:rev, '\n', '', 'g' )
+	let g:hg_revs[ l:key ] = l:rev
+
 	" Add file repo status.
 	"
 	if g:hgrevAddStatus == 1