summaryrefslogtreecommitdiffstats
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
authorIllia Bobyr <illia.bobyr@gmail.com>2023-10-17 18:00:50 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-17 18:06:00 +0200
commit8079917447e7436dccc2e4cd4a4a56ae0a4712f2 (patch)
tree8072a995d7bef59711f4a669f899bd8bc174e6b9 /runtime/doc/builtin.txt
parent5a33ce2a661fb836d4c5c489f2a850172a23e0b0 (diff)
patch 9.0.2041: trim(): hard to use default maskv9.0.2041
Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: #13358 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 38c4b6f688..5f57fdb59d 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -10119,10 +10119,9 @@ trim({text} [, {mask} [, {dir}]]) *trim()*
Return {text} as a String where any character in {mask} is
removed from the beginning and/or end of {text}.
- If {mask} is not given, or is |v:none| (see
- |none-function_argument|), {mask} is all characters up to
- 0x20, which includes Tab, space, NL and CR, plus the
- non-breaking space character 0xa0.
+ If {mask} is not given, or is an empty string, {mask} is all
+ characters up to 0x20, which includes Tab, space, NL and CR,
+ plus the non-breaking space character 0xa0.
The optional {dir} argument specifies where to remove the
characters: