Add a g:gundo_help setting to disable the inline help.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 09 Nov 2010 21:35:34 -0500 |
parents |
d8a13f17507f
|
children |
0cb5b32d3ba0
|
branches/tags |
(none) |
files |
doc/gundo.txt plugin/gundo.vim site/index.html |
Changes
--- a/doc/gundo.txt Tue Nov 09 21:13:21 2010 -0500
+++ b/doc/gundo.txt Tue Nov 09 21:35:34 2010 -0500
@@ -12,7 +12,8 @@
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 @@
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 @@
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.
--- a/plugin/gundo.vim Tue Nov 09 21:13:21 2010 -0500
+++ b/plugin/gundo.vim Tue Nov 09 21:35:34 2010 -0500
@@ -54,8 +54,9 @@
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 @@
endif
endfunction"}}}
+function! s:GundoInlineHelpLength()"{{{
+ if g:gundo_help
+ return 6
+ else
+ return 0
+ endif
+endfunction"}}}
+
"}}}
"{{{ Gundo buffer settings
@@ -723,8 +732,8 @@
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 @@
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')
--- a/site/index.html Tue Nov 09 21:13:21 2010 -0500
+++ b/site/index.html Tue Nov 09 21:35:34 2010 -0500
@@ -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 @@
<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 @@
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