comparison plugin/lawrencium.vim @ 26:de588a4bca10

Fixed completely wrong code that somehow almost ran completely fine.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 20 Dec 2011 16:01:35 -0800
parents 0e952b7c79d7
children 09115be355e2
comparison
equal deleted inserted replaced
25:0e952b7c79d7 26:de588a4bca10
312 return [] 312 return []
313 else 313 else
314 return s:ListRepoFiles(a:ArgLead, a:CmdLine, a:CursorPos) 314 return s:ListRepoFiles(a:ArgLead, a:CmdLine, a:CursorPos)
315 endfunction 315 endfunction
316 316
317 call s:AddMainCommand("-bang -complete=customlist,s:CompleteHg -nargs=* Hg :execute s:Hg(<bang>0, <f-args>)") 317 call s:AddMainCommand("-bang -complete=customlist,s:CompleteHg -nargs=* Hg :call s:Hg(<bang>0, <f-args>)")
318 318
319 " }}} 319 " }}}
320 320
321 " Hgstatus {{{ 321 " Hgstatus {{{
322 322
352 setlocal syntax=hgstatus 352 setlocal syntax=hgstatus
353 353
354 " Add some handy mappings. 354 " Add some handy mappings.
355 nnoremap <buffer> <silent> <C-N> :call search('^[MARC\!\?I ]\s.', 'We')<cr> 355 nnoremap <buffer> <silent> <C-N> :call search('^[MARC\!\?I ]\s.', 'We')<cr>
356 nnoremap <buffer> <silent> <C-P> :call search('^[MARC\!\?I ]\s.','Wbe')<cr> 356 nnoremap <buffer> <silent> <C-P> :call search('^[MARC\!\?I ]\s.','Wbe')<cr>
357 nnoremap <buffer> <silent> <cr> :execute <SID>HgStatus_FileEdit()<cr> 357 nnoremap <buffer> <silent> <cr> :call <SID>HgStatus_FileEdit()<cr>
358 nnoremap <buffer> <silent> <C-D> :execute <SID>HgStatus_FileDiff(0)<cr> 358 nnoremap <buffer> <silent> <C-D> :call <SID>HgStatus_FileDiff(0)<cr>
359 nnoremap <buffer> <silent> <C-V> :execute <SID>HgStatus_FileDiff(1)<cr> 359 nnoremap <buffer> <silent> <C-V> :call <SID>HgStatus_FileDiff(1)<cr>
360 nnoremap <buffer> <silent> <C-A> :execute <SID>HgStatus_FileAdd()<cr> 360 nnoremap <buffer> <silent> <C-A> :call <SID>HgStatus_FileAdd()<cr>
361 nnoremap <buffer> <silent> <C-R> :execute <SID>HgStatus_Refresh()<cr> 361 nnoremap <buffer> <silent> <C-R> :call <SID>HgStatus_Refresh()<cr>
362 nnoremap <buffer> <silent> q :bdelete<cr> 362 nnoremap <buffer> <silent> q :bdelete<cr>
363 363
364 " Make sure the file is deleted with the buffer. 364 " Make sure the file is deleted with the buffer.
365 autocmd BufDelete <buffer> call s:HgStatus_CleanUp(expand('<afile>:p')) 365 autocmd BufDelete <buffer> call s:HgStatus_CleanUp(expand('<afile>:p'))
366 endfunction 366 endfunction
440 function! s:HgStatus_GetSelectedStatus() abort 440 function! s:HgStatus_GetSelectedStatus() abort
441 let l:line = getline('.') 441 let l:line = getline('.')
442 return matchstr(l:line, '\v^[MARC\!\?I ]') 442 return matchstr(l:line, '\v^[MARC\!\?I ]')
443 endfunction 443 endfunction
444 444
445 call s:AddMainCommand("Hgstatus :execute s:HgStatus()") 445 call s:AddMainCommand("Hgstatus :call s:HgStatus()")
446 446
447 " }}} 447 " }}}
448 448
449 " Hgcd, Hglcd {{{ 449 " Hgcd, Hglcd {{{
450 450
593 augroup lawrencium_diff 593 augroup lawrencium_diff
594 autocmd! 594 autocmd!
595 autocmd BufWinLeave * call s:HgDiff_CleanUp() 595 autocmd BufWinLeave * call s:HgDiff_CleanUp()
596 augroup end 596 augroup end
597 597
598 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgdiff :execute s:HgDiff('%:p', 0, <f-args>)") 598 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgdiff :call s:HgDiff('%:p', 0, <f-args>)")
599 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgvdiff :execute s:HgDiff('%:p', 1, <f-args>)") 599 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgvdiff :call s:HgDiff('%:p', 1, <f-args>)")
600 600
601 " }}} 601 " }}}
602 602
603 " Hgcommit {{{ 603 " Hgcommit {{{
604 604
686 echom l:output_line 686 echom l:output_line
687 endfor 687 endfor
688 endif 688 endif
689 endfunction 689 endfunction
690 690
691 call s:AddMainCommand("-bang Hgcommit :execute s:HgCommit(<bang>0, 0)") 691 call s:AddMainCommand("-bang Hgcommit :call s:HgCommit(<bang>0, 0)")
692 call s:AddMainCommand("-bang Hgvcommit :execute s:HgCommit(<bang>0, 1)") 692 call s:AddMainCommand("-bang Hgvcommit :call s:HgCommit(<bang>0, 1)")
693 693
694 " }}} 694 " }}}
695 695
696 " Autoload Functions {{{ 696 " Autoload Functions {{{
697 697