From c15917214b7c76d935ad094d428d01362644daf6 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Tue, 9 Nov 2010 21:35:34 -0500 Subject: [PATCH] Add a g:gundo_help setting to disable the inline help. --- doc/gundo.txt | 13 +++++++++++-- plugin/gundo.vim | 23 ++++++++++++++++++----- site/index.html | 9 +++++++++ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/doc/gundo.txt b/doc/gundo.txt index da68df4..dc8d4fe 100644 --- a/doc/gundo.txt +++ b/doc/gundo.txt @@ -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. diff --git a/plugin/gundo.vim b/plugin/gundo.vim index 0b3806a..a21cd11 100644 --- a/plugin/gundo.vim +++ b/plugin/gundo.vim @@ -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') diff --git a/site/index.html b/site/index.html index 0d75f62..1bf8094 100644 --- a/site/index.html +++ b/site/index.html @@ -93,6 +93,7 @@
  • g:gundo_preview_height
  • g:gundo_preview_bottom
  • g:gundo_right
  • +
  • g:gundo_help
  • g:gundo_disable
  • @@ -282,6 +283,13 @@ let g:gundo_right = 1

    Default: 0 (off, open on the left side)

    + +

    g:gundo_help

    + +

    Set this to 0 to disable the help text in the Gundo graph window.

    + +

    Default: 1 (show the help)

    +

    g:gundo_disable

    @@ -343,6 +351,7 @@ let g:gundo_right = 1 visible but not the current window, instead of moving to them. +
  • Add the g:gundo_help setting.
  • v1.0.0