-
Notifications
You must be signed in to change notification settings - Fork 228
[colorize_nicks.py] Mentioning nick "F1" breaks line prefix #135
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
Labels
bug
Unexpected problem or unintended behavior
Comments
6 tasks
ryoskzypu
added a commit
to ryoskzypu/scripts
that referenced
this issue
May 8, 2025
Changes: - Remove the VALID_NICK regex to not be dependent on RFC spec and change the loop to split only on spaces, so the nick regex is free to match any suffix. - Add nick_prefixes and nick_suffixes options to configure charset affixes. - Replace the default 'greedy' matching with improved 'lazy' matching, because 'greedy' matches nicks incorrectly and crashes weechat. Thus remove ignore_nicks_in_urls option, since 'lazy' matching does not match nicks in substrings. closes weechat#133 and weechat#197. Rationale: - The greedy matching code recolors duplicated strings because of the way replace() works, so it crashes weechat on multiple duplicated nicks. - weechat#259 does not really prevent that, since it can still be reproduced by mentioning a short nick e.g. F1, repeatedly in a message. - It can be fixed by iterating on unique words, but it still colorizes nicks in substrings if a nick is mentioned before (e.g. alice https://www.alice.com), hence the option ignore_nicks_in_urls fails. - Replace hook_modifier() with hook_line() for a more granular parsing (e.g. prefix is separated from message, get filtered lines, etc). closes weechat#70, closes weechat#135. - Add preserving of message colors logic. closes weechat#49, closes weechat#175. - Add irc_only option to ignore non IRC messages (i.e. set buffer restrictions: plugin = irc, tags = irc_privmsg and irc_notice, type = channel and private). - Add do not colorize nicks in filtered messages, and colorize_filtered option. - Add colorizing of IRC prefixes and nicks on IRC private buffers. - Update colorized_input_cb() with the changes, and add decoding of IRC colors from input. - Update config_init() parsing of options. - Remove 'so,root' from blacklist_nicks default option. (These nicks do not make sense for defaults.) - Change min_nick_length default option to 1. (Single char nicks should not be excluded by default.) - Remove hook_modifier() that has the modifier colorize_nicks. (Is it possible to pass custom modifiers?) - Replace % formatting strings with f-strings, " with ', and some code to use the := operator. - Update identifiers, comments, and add some whitespace in code for readability. - Remove unused global keywords and add error handlings. - Remove utf-8 encoding header, add SPDX copyright + license tags, and add upstream link.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Being in a channel with someone with the nick "F1". If that nick gets mentioned, their prefix will be broken, i.e. "F10" prepended:
It seems like the script is interfering with a color code in the line prefix.
Unloading colorize_nicks.py solves the issue. The problem can currently be avoided by adding "F1" to
colorize_nicks.look.blacklist_nicks
.Brought to my attention by lunchdump in #weechat.
The text was updated successfully, but these errors were encountered: