diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-07-24 22:29:07 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-07-24 22:43:48 +0200 |
commit | 68ad24f2df0ace9788da801137dacf43b7fe806a (patch) | |
tree | d0fa35877ef78fa2931393a15cc91235354134a0 /doc/en | |
parent | 1796634d83b90eeb97ede6c238e4092aca948304 (diff) | |
download | weechat-68ad24f2df0ace9788da801137dacf43b7fe806a.zip |
core: add option weechat.look.highlight_disable_regex and buffer property "highlight_disable_regex" (closes #1798)
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/includes/autogen_api_hdata.en.adoc | 2 | ||||
-rw-r--r-- | doc/en/includes/autogen_user_options.en.adoc | 6 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 5 | ||||
-rw-r--r-- | doc/en/weechat_relay_protocol.en.adoc | 2 | ||||
-rw-r--r-- | doc/en/weechat_user.en.adoc | 34 |
5 files changed, 47 insertions, 2 deletions
diff --git a/doc/en/includes/autogen_api_hdata.en.adoc b/doc/en/includes/autogen_api_hdata.en.adoc index 84ca7684d..a98fed949 100644 --- a/doc/en/includes/autogen_api_hdata.en.adoc +++ b/doc/en/includes/autogen_api_hdata.en.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index 33b30465b..8e2298087 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -750,6 +750,12 @@ ** values: any string ** default value: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** description: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** type: string +** values: any string +** default value: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** description: pass:none[POSIX extended regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by delimiters (chars different from: alphanumeric, "-", "_" and "|"), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "flashcode|flashy", "(?-i)FlashCode|flashy"] ** type: string diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index bdf50e3c7..d30cf783a 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -13219,6 +13219,7 @@ Arguments: ** _input_: input text ** _text_search_input_: input saved before text search ** _highlight_words_: list of words to highlight +** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight ** _highlight_regex_: POSIX extended regular expression for highlight ** _highlight_tags_restrict_: restrict highlights to messages with these tags ** _highlight_tags_: force highlight on messages with these tags @@ -13270,6 +13271,7 @@ Arguments: * _property_: property name: ** _plugin_: pointer to plugin which created this buffer (NULL for WeeChat main buffer) +** _highlight_disable_regex_compiled_: regular expression _highlight_disable_regex_ compiled ** _highlight_regex_compiled_: regular expression _highlight_regex_ compiled Return value: @@ -13407,6 +13409,9 @@ Properties: | highlight_words_del | | comma separated list of words | Comma separated list of words to remove from highlighted words on buffer. +| highlight_disable_regex | | any string +| POSIX extended regular expression for disabling highlight. + | highlight_regex | | any string | POSIX extended regular expression for highlight. diff --git a/doc/en/weechat_relay_protocol.en.adoc b/doc/en/weechat_relay_protocol.en.adoc index 8e0749247..2724b2f2a 100644 --- a/doc/en/weechat_relay_protocol.en.adoc +++ b/doc/en/weechat_relay_protocol.en.adoc @@ -691,6 +691,8 @@ inl: text_search_found: 0 text_search_input: None highlight_words: None + highlight_disable_regex: None + highlight_disable_regex_compiled: '0x0' highlight_regex: None highlight_regex_compiled: '0x0' highlight_tags_restrict: None diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index e57c889ca..183035c58 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -2179,6 +2179,36 @@ with `+/script install buffer_autoset.py+` and get help with [[highlights]] === Highlights +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +The buffer property "highlight_disable_regex" is not saved in configuration. + +You can easily save it with the script _buffer_autoset.py_: you can install it +with `+/script install buffer_autoset.py+` and get help with +`+/help buffer_autoset+`. + [[highlights_words]] ==== Add words to highlight @@ -2191,7 +2221,7 @@ You can add other words to highlight with the option highlight your nick and "word1", "word2" and all words beginning with "test": ---- -/set weechat.look.highlight word1,word2,test* +/set weechat.look.highlight "word1,word2,test*" ---- If you need a more specific rule for the word, you can use regular expressions @@ -2199,7 +2229,7 @@ with the option <<option_weechat.look.highlight_regex,weechat.look.highlight_reg for example to highlight words "flashcode", "flashcöde" and "flashy": ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- The delimiters around words to highlight can be customized with the option |