Mercurial > vim-lawrencium
changeset 27:09115be355e2
Fixed a bug with running `Hgedit` on a directory with a trailing backslash.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 20 Dec 2011 16:11:35 -0800 |
parents | de588a4bca10 |
children | 0cdfdab43907 |
files | plugin/lawrencium.vim |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugin/lawrencium.vim Tue Dec 20 16:01:35 2011 -0800 +++ b/plugin/lawrencium.vim Tue Dec 20 16:11:35 2011 -0800 @@ -455,7 +455,16 @@ " Hgedit {{{ -call s:AddMainCommand("-bang -nargs=? -complete=customlist,s:ListRepoFiles Hgedit :edit<bang> `=s:hg_repo().GetFullPath(<q-args>)`") +function! s:HgEdit(bang, filename) abort + let l:full_path = s:hg_repo().GetFullPath(a:filename) + if a:bang + execute "edit! " . l:full_path + else + execute "edit " . l:full_path + endif +endfunction + +call s:AddMainCommand("-bang -nargs=? -complete=customlist,s:ListRepoFiles Hgedit :call s:HgEdit(<bang>0, <f-args>)") " }}}