comparison plugin/lawrencium.vim @ 75:066c8654e754

Reverted some automatic `Hgstatus` window refresh. Apparently Vim doesn't like what I'm doing. Sigh.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 16 Feb 2014 23:52:29 -0800
parents e023d7764361
children f535cda5d20e
comparison
equal deleted inserted replaced
74:e023d7764361 75:066c8654e754
898 vnoremap <buffer> <silent> <C-A> :Hgstatusaddremove<cr> 898 vnoremap <buffer> <silent> <C-A> :Hgstatusaddremove<cr>
899 vnoremap <buffer> <silent> <C-S> :Hgstatuscommit<cr> 899 vnoremap <buffer> <silent> <C-S> :Hgstatuscommit<cr>
900 endif 900 endif
901 endfunction 901 endfunction
902 902
903 function! s:HgStatus_Refresh(...) abort 903 function! s:HgStatus_Refresh() abort
904 if a:0 == 0 904 " Just re-edit the buffer, it will reload the contents by calling
905 " Just re-edit the buffer, it will reload the contents by calling 905 " the matching Mercurial command.
906 " the matching Mercurial command. 906 edit
907 edit
908 else
909 " Re-edit the given buffer.
910 execute 'buf ' . a:1
911 edit
912 endif
913 endfunction 907 endfunction
914 908
915 function! s:HgStatus_FileEdit() abort 909 function! s:HgStatus_FileEdit() abort
916 " Get the path of the file the cursor is on. 910 " Get the path of the file the cursor is on.
917 let l:filename = s:HgStatus_GetSelectedFile() 911 let l:filename = s:HgStatus_GetSelectedFile()
952 if len(l:filenames) == 0 946 if len(l:filenames) == 0
953 call s:error("No files to commit in selection or file.") 947 call s:error("No files to commit in selection or file.")
954 return 948 return
955 endif 949 endif
956 950
957 " Remember which buffer this is.
958 let l:status_nr = bufnr('%')
959
960 " Run `Hgcommit` on those paths. 951 " Run `Hgcommit` on those paths.
961 call s:HgCommit(a:bang, a:vertical, l:filenames) 952 call s:HgCommit(a:bang, a:vertical, l:filenames)
962
963 " At this point we should be in the commit message buffer.
964 " Let's refresh the status window when that buffer gets deleted.
965 let l:bufobj = s:buffer_obj()
966 call l:bufobj.OnDelete('call s:HgStatus_Refresh(' . l:status_nr . ')')
967 endfunction 953 endfunction
968 954
969 function! s:HgStatus_Diff(vertical) abort 955 function! s:HgStatus_Diff(vertical) abort
970 " Open the file and run `Hgdiff` on it. 956 " Open the file and run `Hgdiff` on it.
971 call s:HgStatus_FileEdit() 957 call s:HgStatus_FileEdit()