comparison plugin/lawrencium.vim @ 25:0e952b7c79d7

Fixed a bug with opening a diff from `Hgstatus` When the previous window from the `Hgstatus` window was not a Lawrencium tracked window, the command would fail, or could even use the wrong repo.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 20 Dec 2011 15:32:22 -0800
parents 21a879a09f20
children de588a4bca10
comparison
equal deleted inserted replaced
24:21a879a09f20 25:0e952b7c79d7
420 " Refresh the status window. 420 " Refresh the status window.
421 call s:HgStatus_Refresh() 421 call s:HgStatus_Refresh()
422 endfunction 422 endfunction
423 423
424 function! s:HgStatus_FileDiff(vertical) abort 424 function! s:HgStatus_FileDiff(vertical) abort
425 " Get the path of the file the cursor is on. 425 " Open the file and run `Hgdiff` on it.
426 let l:filename = s:HgStatus_GetSelectedPath() 426 call s:HgStatus_FileEdit()
427 427 call s:HgDiff('%:p', a:vertical)
428 " Go back to the previous window and call HgDiff.
429 wincmd p
430 call s:HgDiff(l:filename, a:vertical)
431 endfunction 428 endfunction
432 429
433 function! s:HgStatus_GetSelectedPath() abort 430 function! s:HgStatus_GetSelectedPath() abort
434 let l:repo = s:hg_repo() 431 let l:repo = s:hg_repo()
435 let l:line = getline('.') 432 let l:line = getline('.')