Commits

Ian Liu Rodrigues committed ae005db

Fix Hgstatus when preview window is already opened

  • Participants
  • Parent commits 66d06a8

Comments (0)

Files changed (1)

 endf
 
 fun! s:Hgstatus()
+  pclose
   pedit hg2o://status
   wincmd P
   nnoremap <buffer> <silent> q    :<C-U>bdelete<CR>
   nnoremap <buffer> <silent> <CR> :<C-U>exe <SID>CRStatus()<CR>
   silent execute '0read !'.s:HG.' status'
+  normal Gdd
+  call cursor('1', '1')
+  let nl = line('$') + 1
+  if nl > 10
+    let nl = 10
+  endif
+  execute 'res '.nl
   setlocal bufhidden=wipe nomodifiable nomodified readonly ft=hgstatus
 endf
 " }}}1
   let ft = &ft
   let path = expand('%')
   let file = expand('%:t')
+  let wnr = bufwinnr('%')
+  let save_cursor = getpos('.')
   diffthis
   execute 'vnew hg2o://diff/'.file
   silent execute '0read !'.s:HG.' cat '.path
+  normal Gdd
   execute 'setlocal ft='.ft
   setlocal bufhidden=wipe readonly nomodified nomodifiable
   diffthis
   wincmd p
+  call setpos('.', save_cursor)
 endf
 " }}}1
+" Hgcommit {{{1
+com! -nargs=0 Hgcommit :execute s:Hgcommit()
+
+fun! s:Hgcommit()
+endf
+" }}}1