From 282444b2d6851f5d38e96cc5a4ceea9749b7d3b4 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 17 Oct 2025 10:31:24 +0200 Subject: [PATCH 1/3] go.py: Add regexp_search option --- python/go.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/go.py b/python/go.py index c4f7f8ed..709c289a 100644 --- a/python/go.py +++ b/python/go.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # +# Copyright (C) 2025 Leo Vivier # Copyright (C) 2009-2023 Sébastien Helleu # Copyright (C) 2010 m4v # Copyright (C) 2011 stfn @@ -148,6 +149,9 @@ 'color_name_highlight_selected': ( 'red,brown', 'color for highlight in a selected buffer name'), + 'regexp_search': ( + 'off', + 'search buffer matches using regexps'), 'fuzzy_search': ( 'off', 'search buffer matches using approximation'), @@ -356,7 +360,10 @@ def go_matching_buffers(strinput): full_name = '%s.%s' % ( weechat.infolist_string(infolist, 'plugin_name'), weechat.infolist_string(infolist, 'name')) - matching = name.lower().find(strinput) >= 0 + if go_option_enabled('regexp_search'): + matching = bool(re.search(strinput, name, re.IGNORECASE)) + else: + matching = name.lower().find(strinput) >= 0 if not matching and strinput[-1] == ' ': matching = name.lower().endswith(strinput.strip()) if not matching and go_option_enabled('fuzzy_search'): From 45c1b1b74e1e0d871d275fc97c73d53dac6682d1 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 17 Oct 2025 10:31:55 +0200 Subject: [PATCH 2/3] go.py: Add cancel with /window scroll_bottom --- python/go.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/go.py b/python/go.py index 709c289a..31b05385 100644 --- a/python/go.py +++ b/python/go.py @@ -553,6 +553,10 @@ def go_command_run_buffer(data, buf, command): def go_command_run_window(data, buf, command): """Function called when a command "/window xxx" is run.""" + if command == '/window scroll_bottom': + # cancel selection and return to input + go_end(buf) + return weechat.WEECHAT_RC_OK_EAT return weechat.WEECHAT_RC_OK_EAT From 492a2df61ae200c863c48daa42c372b73017166e Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 17 Oct 2025 10:35:31 +0200 Subject: [PATCH 3/3] Update changelog --- python/go.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/go.py b/python/go.py index 31b05385..522cead9 100644 --- a/python/go.py +++ b/python/go.py @@ -22,6 +22,8 @@ # # History: # +# 2025-10-17, Leo Vivier : +# version 3.0.2: add regexp search and cancellation with scroll_bottom # 2024-05-30, Sébastien Helleu : # version 3.0.1: refresh buffer input at the end of search # 2024-05-30, Sébastien Helleu :