diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2021-10-03 17:33:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-03 17:33:12 -0700 |
| commit | 8a9f292991bca7d84a987be7b0eb0fd675a8dbb1 (patch) | |
| tree | e50c0b176ab90c7b1f8aa4a9ddd9db43ef3a1095 /runtime/doc | |
| parent | a0bf28cd54925f1aae522cd2243656bb6162bb57 (diff) | |
| parent | 84f66909e4008a57da947f1640bfc24da5e41a72 (diff) | |
| download | rneovim-8a9f292991bca7d84a987be7b0eb0fd675a8dbb1.tar.gz rneovim-8a9f292991bca7d84a987be7b0eb0fd675a8dbb1.tar.bz2 rneovim-8a9f292991bca7d84a987be7b0eb0fd675a8dbb1.zip | |
Merge #15218 from gpanders/split-trimempty
feat(lua): add "noempty" param to vim.split()
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/lua.txt | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 22e323baa7..f6daa70b4c 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1373,20 +1373,25 @@ pesc({s}) *vim.pesc()* See also: ~ https://github.com/rxi/lume -split({s}, {sep}, {plain}) *vim.split()* +split({s}, {sep}, {kwargs}) *vim.split()* Splits a string at each instance of a separator. Examples: > - split(":aa::b:", ":") --> {'','aa','','b',''} - split("axaby", "ab?") --> {'','x','y'} - split(x*yz*o, "*", true) --> {'x','yz','o'} + + split(":aa::b:", ":") --> {'','aa','','b',''} + split("axaby", "ab?") --> {'','x','y'} + split("x*yz*o", "*", {plain=true}) --> {'x','yz','o'} + split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'} < Parameters: ~ - {s} String to split - {sep} Separator string or pattern - {plain} If `true` use `sep` literally (passed to - String.find) + {s} String to split + {sep} Separator string or pattern + {kwargs} Keyword arguments: + • plain: (boolean) If `true` use `sep` literally + (passed to string.find) + • trimempty: (boolean) If `true` remove empty + items from the front and back of the list Return: ~ List-like table of the split components. |