Git Product home page Git Product logo

Comments (2)

de-vri-es avatar de-vri-es commented on May 27, 2024

Note that for me, these settings worked as expected:

autosort: Sorting rules:
    0: core = 0
    1: irc = 2
    2: i3 = 99
    3: * = 1
    4: irc.server = 1
    5: irc.irc_raw = 0
    6: irc.server.*.#* = 0
    7: irc.server.*.[*]status = 1
    8: irc.server.*.[*]* = 2
autosort: Replacement patterns:
    0: ## -> #
    1: irc.freenode.#i3 -> i3

Maybe there are some subtle Python version dependent behaviour. My weechat is using python 2.7.13. @squigglezworth: Could you check your python version?

from weechat-autosort.

de-vri-es avatar de-vri-es commented on May 27, 2024

After some more debugging on irc, I think the observed behaviour can be explained.

The first replacement pattern used was freenode.#i3 -> i3. That caused the buffer name after replacement patterns were applied to be irc.i3. The group_irc option then turned that into irc.server.i3 before the sort rules were applied. In sort rules * doesn't match periods, so the sort rule *i3* never matched the correct buffer and it ended up being sorted alphabetically with the server buffers.

During debugging we did try a number of replacement patterns and sort rules, but apparently never the correct combination at the same time. With the replacement pattern freenode.#i3 -> i3 and group_irc = on, the correct sort rule would be irc.server.i3 = .... With group_irc= off it would be irc.i3 = ....

Alternatively, the replacement pattern irc.freenode.#i3 -> i3 can be used with the rule i3 = .... This doesn't behave exactly the same as the previous option, so both can be valid use cases.

It also got me thinking that a /autosort debug command to show the result of replacement patterns and sort rules might be useful, but thats a seperate issue. The same goes for allowing regexes or glob-style patterns in sort rules.

from weechat-autosort.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.