##// END OF EJS Templates
HGcommand.vim : HGCommandEnableBufferSetup on by default
"Mathieu Clabaut " -
r2607:070736e2 default
parent child Browse files
Show More
@@ -375,8 +375,8 b' endfunction'
375 " Function: s:HGSetupBuffer() {{{2
375 " Function: s:HGSetupBuffer() {{{2
376 " Attempts to set the b:HGBranch, b:HGRevision and b:HGRepository variables.
376 " Attempts to set the b:HGBranch, b:HGRevision and b:HGRepository variables.
377
377
378 function! s:HGSetupBuffer()
378 function! s:HGSetupBuffer(...)
379 if (exists("b:HGBufferSetup") && b:HGBufferSetup)
379 if (exists("b:HGBufferSetup") && b:HGBufferSetup && !exists('a:1'))
380 " This buffer is already set up.
380 " This buffer is already set up.
381 return
381 return
382 endif
382 endif
@@ -608,6 +608,8 b' function! HGEnableBufferSetup()'
608 augroup HGCommandPlugin
608 augroup HGCommandPlugin
609 au!
609 au!
610 au BufEnter * call s:HGSetupBuffer()
610 au BufEnter * call s:HGSetupBuffer()
611 " Force resetting up buffer on external file change (HG update)
612 au FileChangedShell * call s:HGSetupBuffer(1)
611 augroup END
613 augroup END
612
614
613 " Only auto-load if the plugin is fully loaded. This gives other plugins a
615 " Only auto-load if the plugin is fully loaded. This gives other plugins a
@@ -752,7 +754,8 b' function! s:HGCommit(...)'
752 \ ':call <SID>HGFinishCommit("' . messageFileName . '",' .
754 \ ':call <SID>HGFinishCommit("' . messageFileName . '",' .
753 \ '"' . newCwd . '",' .
755 \ '"' . newCwd . '",' .
754 \ '"' . realFileName . '",' .
756 \ '"' . realFileName . '",' .
755 \ hgBufferCheck . ')<CR>'
757 \ hgBufferCheck . ')<CR>'.
758 \ ':call <SID>HGBufferSetup(1)<CR>'
756
759
757 silent 0put ='HG: ----------------------------------------------------------------------'
760 silent 0put ='HG: ----------------------------------------------------------------------'
758 silent put =\"HG: Enter Log. Lines beginning with `HG:' are removed automatically\"
761 silent put =\"HG: Enter Log. Lines beginning with `HG:' are removed automatically\"
@@ -905,6 +908,7 b' endfunction'
905 " Function: s:HGUpdate() {{{2
908 " Function: s:HGUpdate() {{{2
906 function! s:HGUpdate()
909 function! s:HGUpdate()
907 return s:HGMarkOrigBufferForSetup(s:HGDoCommand('update', 'update', ''))
910 return s:HGMarkOrigBufferForSetup(s:HGDoCommand('update', 'update', ''))
911 call s:HGSetupBuffer(1)
908 endfunction
912 endfunction
909
913
910 " Function: s:HGVimDiff(...) {{{2
914 " Function: s:HGVimDiff(...) {{{2
@@ -1170,7 +1174,7 b' augroup END'
1170
1174
1171 " Section: Optional activation of buffer management {{{1
1175 " Section: Optional activation of buffer management {{{1
1172
1176
1173 if s:HGGetOption('HGCommandEnableBufferSetup', 0)
1177 if s:HGGetOption('HGCommandEnableBufferSetup', 1)
1174 call HGEnableBufferSetup()
1178 call HGEnableBufferSetup()
1175 endif
1179 endif
1176
1180
@@ -1630,8 +1634,8 b' 5.5 HGCommand buffer management\t\t '
1630 status' will be invoked at each entry into a buffer (during the |BufEnter|
1634 status' will be invoked at each entry into a buffer (during the |BufEnter|
1631 autocommand).
1635 autocommand).
1632
1636
1633 This mode is disabled by default. In order to enable it, set the
1637 This mode is enablmed by default. In order to disable it, set the
1634 |HGCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling
1638 |HGCommandEnableBufferSetup| variable to a false (zero) value. Enabling
1635 this mode simply provides the buffer variables mentioned above. The user
1639 this mode simply provides the buffer variables mentioned above. The user
1636 must explicitly include those in the |'statusline'| option if they are to
1640 must explicitly include those in the |'statusline'| option if they are to
1637 appear in the status line (but see |hgcommand-statusline| for a simple way
1641 appear in the status line (but see |hgcommand-statusline| for a simple way
General Comments 0
You need to be logged in to leave comments. Login now