de-vri-es / weechat-autosort

Automatically keep your buffers sorted.
GNU General Public License v3.0
76 stars 8 forks source link

Autosort will not sort my buffers by server properly #2

Closed seitzbg closed 9 years ago

seitzbg commented 9 years ago

I have tried using irc.server.servername.* = value with no luck, any hints would be appreciated.

I have v2.5

de-vri-es commented 9 years ago

Have you got irc.look.server_buffer set to independent? By default all server buffers are merged and can not be sorted independently. The result is an unexpected sorting order.

You can check with /set irc.look.server_buffer or set it with /set irc.look.server_buffer independent

Another setting that I find works well with autosort is /set buffers.look.indenting on. If you're using buffers.pl anyway.

quite commented 9 years ago

Do you mean that it is not possible to alter the order of groups of channels (per server) without using independent? Ordering channels from one certain server to come before those of a certain other server is precisely what I would like to accomplish. But I don't succeed, not even when setting independent and enabling indenting

de-vri-es commented 9 years ago

Well, the channel buffers can be sorted regardless of the position of the server buffer, but if you want a tree-like view the server buffers should be independent.

If you want to order one particular server before another you can run:

/autosort rules add irc.server.{server_to_sort_first} = 0
ghost commented 9 years ago

Image

As you can see, that doesn't work for me. Am I doing something wrong? I tried both of those /set commands and nothing.

The ideal layout here would be: core Rizon and channels/queries SystemNet and channel/queries Other servers with their channels/queries Everything else (script, iset, etc)

de-vri-es commented 9 years ago

Hey @Joaquin-V

For the situation you describe the rule list should look like this:

core = 0
irc = 1
irc.server.Rizon = 0
ir.server.SystemNet = 1

It's fine to assign the same score to different rules if they work on different levels. Additionally, anything not matched by a rule should be put after anything that did match a rule by default, so * = 5 should not be necessary.

However, looking at the rule list you got, it should also sort the IRC servers properly with respect to each other, though it wouldn't place non-core non-irc buffers last right now (thats what irc = 1 is for).

You could verify that the buffers are really called irc.server.Rizon and irc.server.SystemNet by running /buffer list. If you set a separate display name (/buffer set short_name ...), autosort still sorts on the real name.

ghost commented 9 years ago

Hi, @de-vri-es

Still nothing, it orders my servers alphabetically.

Image

I checked /buffer list and the buffers are indeed named irc.server.<server name>.

de-vri-es commented 9 years ago

@Joaquin-V: That is strange. Could you tell me which weechat version, autosort version and python version you are using?

ghost commented 9 years ago

@de-vri-es

WeeChat 1.3 Python 3.4.3 / 2.7.10 autosort 2.5

de-vri-es commented 9 years ago

@Joaquin-V Found the problem. When the case_insensitive option is enabled the buffer names are always lowercased. The rules however aren't. I will fix this, but in the mean time you can get the desired result by writing the server names in lowercase.

de-vri-es commented 9 years ago

Alright, case in rules is now properly ignored when doing case insensitive sorting. Should fix your issue @Joaquin-V . Fix in 769ec5791e777dca206d86029a2a0de734aeb1b5.

I also submitted the new version to the weechat script repository, but it may take a short while before it is reviewed.