From 112bebcddf99d5187ede8ebbe765abc75373c4f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= <flashcode@flashtux.org>
Date: Mon, 24 Apr 2017 22:37:49 +0200
Subject: core: add a way to count the suffix length in max chars displayed in
 cut of string ("cut:" and "cutscr:") (closes #963)

The format to use is one of:

- ${cut:+max,suffix,string}
- ${cutscr:+max,suffix,string}

With the "+" before max, WeeChat ensures there are at most "max" chars in
output, including the length of suffix string.
---
 doc/en/weechat_plugin_api.en.adoc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'doc/en/weechat_plugin_api.en.adoc')

diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 461655410..2d3091af6 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -2043,19 +2043,27 @@ expanded to last):
   `+********+`
 
 | `+${cut:max,suffix,string}+` +
+  `+${cut:+max,suffix,string}+` +
   (_WeeChat ≥ 1.8_) |
-  String with `max` chars, and optional `suffix` if string is cut. |
+  String with `max` chars, and optional `suffix` if string is cut. +
+  With the format `+max`, the suffix is counted in max length. |
   `+${cut:4,…,this is a test}+` +
+  `+${cut:+4,…,this is a test}+` +
   `+${cut:2,>>,こんにちは世界}+` |
   `+this…+` +
+  `+t…+` +
   `+こん>>+`
 
 | `+${cutscr:max,suffix,string}+` +
+  `+${cutscr:+max,suffix,string}+` +
   (_WeeChat ≥ 1.8_) |
-  String with `max` chars displayed on screen, and optional `suffix` if string is cut. |
+  String with `max` chars displayed on screen, and optional `suffix` if string is cut. +
+  With the format `+max`, the suffix is counted in max length. |
   `+${cutscr:4,…,this is a test}+` +
+  `+${cutscr:+4,…,this is a test}+` +
   `+${cutscr:2,>>,こんにちは世界}+` |
   `+this…+` +
+  `+thi…+` +
   `+こ>>+`
 
 | `+${re:N}+` +
-- 
cgit v1.2.3

