Skip to content

Commit 13aef99

Browse files
de-vri-esflashcode
authored andcommitted
autosort.py 3.10: Fix /autosort helper swap command.
1 parent 794f948 commit 13aef99

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

python/autosort.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#
2727
# Changelog:
28+
# 3.10:
29+
# * Fix exception in `/autosort helpers swap`.
2830
# 3.9:
2931
# * Remove `buffers.pl` from recommended settings.
3032
# 3,8:
@@ -87,7 +89,7 @@
8789

8890
SCRIPT_NAME = 'autosort'
8991
SCRIPT_AUTHOR = 'Maarten de Vries <[email protected]>'
90-
SCRIPT_VERSION = '3.9'
92+
SCRIPT_VERSION = '3.10'
9193
SCRIPT_LICENSE = 'GPL3'
9294
SCRIPT_DESC = 'Flexible automatic (or manual) buffer sorting based on eval expressions.'
9395

@@ -616,7 +618,6 @@ def command_helper_swap(buffer, command, args):
616618
except KeyError as e:
617619
raise HumanReadableError('No such helper: {0}'.format(e.args[0]))
618620

619-
config.helpers.swap(index_a, index_b)
620621
config.save_helpers()
621622
command_helper_list(buffer, command, '')
622623
return weechat.WEECHAT_RC_OK
@@ -829,7 +830,7 @@ def on_autosort_command(data, buffer, args):
829830

830831
def add_completions(completion, words):
831832
for word in words:
832-
weechat.hook_completion_list_add(completion, word, 0, weechat.WEECHAT_LIST_POS_END)
833+
weechat.completion_list_add(completion, word, 0, weechat.WEECHAT_LIST_POS_END)
833834

834835
def autosort_complete_rules(words, completion):
835836
if len(words) == 0:
@@ -1001,14 +1002,14 @@ def on_autosort_complete(data, name, buffer, completion):
10011002
10021003
{*white}# Recommended settings
10031004
For the best visual effect, consider setting the following options:
1004-
{*white}/set {cyan}irc.look.server_buffer{reset} {brown}independent{reset}
1005+
{*white}/set {cyan}irc.look.server_buffer{reset} {brown}independent{reset}
10051006
10061007
This setting allows server buffers to be sorted independently, which is
10071008
needed to create a hierarchical tree view of the server and channel buffers.
10081009
10091010
If you are using the {*default}buflist{reset} plugin you can (ab)use Unicode to draw a tree
10101011
structure with the following setting (modify to suit your need):
1011-
{*white}/set {cyan}buflist.format.indent {brown}"${{color:237}}${{if:${{buffer.next_buffer.local_variables.type}}=~^(channel|private)$?├─:└─}}"{reset}
1012+
{*white}/set {cyan}buflist.format.indent {brown}"${{color:237}}${{if:${{buffer.next_buffer.local_variables.type}}=~^(channel|private)$?├─:└─}}"{reset}
10121013
'''
10131014

10141015
command_completion = '%(plugin_autosort) %(plugin_autosort) %(plugin_autosort) %(plugin_autosort) %(plugin_autosort)'

0 commit comments

Comments
 (0)