From 0068ca0a56d161a879523288d81b94a11ed3d1da Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 1 Jun 2017 18:56:49 +0200 Subject: weechat: go.py: 2.4 -> 2.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/python/go.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'weechat/python') diff --git a/weechat/python/go.py b/weechat/python/go.py index 3d1828b..a30f58f 100644 --- a/weechat/python/go.py +++ b/weechat/python/go.py @@ -21,12 +21,14 @@ # # History: # +# 2017-04-01, Sébastien Helleu : +# version 2.5: add option "buffer_number" # 2017-03-02, Sébastien Helleu : # version 2.4: fix syntax and indentation error # 2017-02-25, Simmo Saan # version 2.3: fix fuzzy search breaking buffer number search display # 2016-01-28, ylambda -# version 2.2: add option fuzzy_search +# version 2.2: add option "fuzzy_search" # 2015-11-12, nils_2 # version 2.1: fix problem with buffer short_name "weechat", using option # "use_core_instead_weechat", see: @@ -42,7 +44,7 @@ # version 1.8: fix jump to non-active merged buffers (jump with buffer name # instead of number) # 2012-01-03 nils_2 -# version 1.7: add option use_core_instead_weechat +# version 1.7: add option "use_core_instead_weechat" # 2012-01-03, Sébastien Helleu : # version 1.6: make script compatible with Python 3.x # 2011-08-24, stfn : @@ -56,9 +58,9 @@ # version 1.2: use high priority for hooks to prevent conflict with other # plugins/scripts (WeeChat >= 0.3.4 only) # 2010-03-25, Elián Hanisch : -# version 1.1: use a space for match the end of a string +# version 1.1: use a space to match the end of a string # 2009-11-16, Sébastien Helleu : -# version 1.0: add new option for displaying short names +# version 1.0: add new option to display short names # 2009-06-15, Sébastien Helleu : # version 0.9: fix typo in /help go with command /key # 2009-05-16, Sébastien Helleu : @@ -90,7 +92,7 @@ from __future__ import print_function SCRIPT_NAME = 'go' SCRIPT_AUTHOR = 'Sébastien Helleu ' -SCRIPT_VERSION = '2.4' +SCRIPT_VERSION = '2.5' SCRIPT_LICENSE = 'GPL3' SCRIPT_DESC = 'Quick jump to buffers' @@ -151,6 +153,9 @@ SETTINGS = { 'fuzzy_search': ( 'off', 'search buffer matches using approximation'), + 'buffer_number': ( + 'on', + 'display buffer number'), } # hooks management @@ -434,10 +439,13 @@ def go_buffers_to_string(listbuf, pos, strinput): name += buffer_name[prev_index+1:] else: name = buffer_name - string += ' %s%s%s%s%s' % ( - weechat.color(weechat.config_get_plugin( - 'color_number' + selected)), - str(listbuf[i]['number']), + string += ' ' + if go_option_enabled('buffer_number'): + string += '%s%s' % ( + weechat.color(weechat.config_get_plugin( + 'color_number' + selected)), + str(listbuf[i]['number'])) + string += '%s%s%s' % ( weechat.color(weechat.config_get_plugin( 'color_name' + selected)), name, -- cgit v1.2.3-70-g09d2