Skip to content

Commit 337e446

Browse files
committed
histsearch.py 0.7: send buffer pointer with signal "input_text_changed"
This fixes a crash in the typing plugin that relies on this buffer pointer.
1 parent aeb74b7 commit 337e446

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/histsearch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
#
2525
# History:
2626
#
27+
# 2023-01-08, Sébastien Helleu <[email protected]>
28+
# version 0.7: send buffer pointer with signal "input_text_changed"
2729
# 2019-10-31, Simmo Saan <[email protected]>
2830
# version 0.6: fix hook_command_run hooks not being unhooked
29-
# 2019-07-11, Sébastien Helleu <[email protected]>:
31+
# 2019-07-11, Sébastien Helleu <[email protected]>
3032
# version 0.5: make script compatible with Python 3
3133
# 2019-07-11, Simmo Saan <[email protected]>
3234
# version 0.4: fix detection of "/input search_text_here"
@@ -43,7 +45,7 @@
4345

4446
SCRIPT_NAME = "histsearch"
4547
SCRIPT_AUTHOR = "xt <[email protected]>"
46-
SCRIPT_VERSION = "0.6"
48+
SCRIPT_VERSION = "0.7"
4749
SCRIPT_LICENSE = "GPL3"
4850
SCRIPT_DESC = "Quick search in command history (think ctrl-r in bash)"
4951
SCRIPT_COMMAND = 'histsearch'
@@ -220,15 +222,15 @@ def command_run_input(data, buffer, command):
220222
if commands_pos >= len(commands):
221223
commands_pos = 0
222224
w.hook_signal_send("input_text_changed",
223-
w.WEECHAT_HOOK_SIGNAL_STRING, "")
225+
w.WEECHAT_HOOK_SIGNAL_POINTER, buffer)
224226
return w.WEECHAT_RC_OK_EAT
225227
elif command == "/input complete_previous":
226228
# choose previous buffer in list
227229
commands_pos -= 1
228230
if commands_pos < 0:
229231
commands_pos = len(commands) - 1
230232
w.hook_signal_send("input_text_changed",
231-
w.WEECHAT_HOOK_SIGNAL_STRING, "")
233+
w.WEECHAT_HOOK_SIGNAL_POINTER, buffer)
232234
return w.WEECHAT_RC_OK_EAT
233235
elif command == "/input return":
234236
# As in enter was pressed.

0 commit comments

Comments
 (0)