Add a g:gundo_help setting to disable the inline help.

This commit is contained in:
Steve Losh 2010-11-09 21:35:34 -05:00
parent 09fcef2178
commit c15917214b
3 changed files with 38 additions and 7 deletions

View File

@ -12,7 +12,8 @@ CONTENTS *Gundo-contents*
3.2 gundo_preview_height ...... |gundo_preview_height|
3.3 gundo_preview_bottom ...... |gundo_preview_bottom|
3.4 gundo_right ............... |gundo_right|
3.5 gundo_disable ............. |gundo_disable|
3.5 gundo_help ................ |gundo_help|
3.6 gundo_disable ............. |gundo_disable|
4. License ........................ |GundoLicense|
5. Bugs ........................... |GundoBugs|
6. Contributing ................... |GundoContributing|
@ -159,7 +160,14 @@ instead of the left.
Default: 0 (off, open on the left side)
------------------------------------------------------------------------------
3.5 g:gundo_disable *gundo_disable*
3.5 g:gundo_help *gundo_help*
Set this to 0 to disable the help text in the Gundo graph window.
Default: 1 (show the help)
------------------------------------------------------------------------------
3.6 g:gundo_disable *gundo_disable*
Set this to 1 to disable Gundo entirely.
@ -198,6 +206,7 @@ Development version
current window, instead of moving to them.
* Add the 'p' mapping to preview the result of reverting to the selected
state.
* Add the g:gundo_help setting.
v1.0.0
* Initial stable release.

View File

@ -54,8 +54,9 @@ endif"}}}
if !exists('g:gundo_right')"{{{
let g:gundo_right = 0
endif"}}}
let s:inline_help_length = 6
if !exists('g:gundo_help')"{{{
let g:gundo_help = 1
endif"}}}
"}}}
@ -511,6 +512,14 @@ function! s:GundoIsVisible()"{{{
endif
endfunction"}}}
function! s:GundoInlineHelpLength()"{{{
if g:gundo_help
return 6
else
return 0
endif
endfunction"}}}
"}}}
"{{{ Gundo buffer settings
@ -723,8 +732,8 @@ function! s:GundoMove(direction) range"{{{
let target_n = line('.') + (distance * a:direction)
" Bound the movement to the graph.
if target_n <= s:inline_help_length - 1
call cursor(s:inline_help_length, 0)
if target_n <= s:GundoInlineHelpLength() - 1
call cursor(s:GundoInlineHelpLength(), 0)
else
call cursor(target_n, 0)
endif
@ -849,7 +858,11 @@ def GundoRenderGraph():
result = [' ' + l for l in result]
target = (vim.eval('g:gundo_target_f'), int(vim.eval('g:gundo_target_n')))
header = (INLINE_HELP % target).splitlines()
if int(vim.eval('g:gundo_help')):
header = (INLINE_HELP % target).splitlines()
else:
header = []
vim.command('call s:GundoOpenGraph()')
vim.command('setlocal modifiable')

View File

@ -93,6 +93,7 @@
<li><a href="#gundo_preview_height">g:gundo_preview_height</a></li>
<li><a href="#gundo_preview_bottom">g:gundo_preview_bottom</a></li>
<li><a href="#gundo_right">g:gundo_right</a></li>
<li><a href="#gundo_help">g:gundo_help</a></li>
<li><a href="#gundo_disable">g:gundo_disable</a></li>
</ul>
</li>
@ -282,6 +283,13 @@ let g:gundo_right = 1
<p>Default: 0 (off, open on the left side)</p>
<a name="gundo_help"></a>
<h2>g:gundo_help</h2>
<p>Set this to 0 to disable the help text in the Gundo graph window.</p>
<p>Default: 1 (show the help)</p>
<a name="gundo_disable"></a>
<h2>g:gundo_disable</h2>
@ -343,6 +351,7 @@ let g:gundo_right = 1
visible but not the current window, instead of
moving to them.
</li>
<li>Add the g:gundo_help setting.</li>
</ul>
</li>
<li>v1.0.0