Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[colorize_nicks.py] colorizes the middle of a word #365

Open
mgedmin opened this issue Sep 27, 2019 · 3 comments
Open

[colorize_nicks.py] colorizes the middle of a word #365

mgedmin opened this issue Sep 27, 2019 · 3 comments
Labels
bug Unexpected problem or unintended behavior

Comments

@mgedmin
Copy link

mgedmin commented Sep 27, 2019

There's a user with nick e in the #vim channel on FreeNode. This results in

Ekrano nuotrauka iš 2019-09-27 16-29-46

What is strange to me is that only the e in new is highlighted: the e in maybe, or open or files or :tabe or :e are not highligted (nor should they be! except maybe the e in :e might make sense).

@flashcode flashcode added the bug Unexpected problem or unintended behavior label Oct 1, 2019
@sim642
Copy link
Member

sim642 commented Oct 31, 2019

What value do you have set for colorize_nicks.look.greedy_matching? By default it is on but I've found off` to work better in general, maybe that also fixes this.

Also what value do you have for colorize_nicks.look.min_nick_length? By default it should be 2, so just "e" shouldn't ever be handled. Unless the issue is deeper than that.

@mgedmin
Copy link
Author

mgedmin commented Nov 1, 2019

I don't remember ever changing any settings. ~/.weechat/colorize_nicks.conf has

[look]
blacklist_channels = ""
blacklist_nicks = "so,root"
colorize_input = off
greedy_matching = on
ignore_nicks_in_urls = off
ignore_tags = ""
match_limit = 20
min_nick_length = 2

Looking at the code, I think I see how the min_nick_length can be circumvented: the length check happens before the

        # If the matched word is not a known nick, we try to match the
        # word without its first or last character (if not a letter).
        # This is necessary as "foo:" is a valid nick, which could be
        # adressed as "foo::".

logic, which then cuts off the first : in :e.

@weechatter
Copy link
Contributor

disable greedy_matching first:
/set colorize_nicks.look.greedy_matching off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants