diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-19 17:58:54 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-05-19 17:58:54 +0200 |
commit | e4c2d85c7729925128746d08883286b75fb097a8 (patch) | |
tree | f8b0295997e28da4815302b0222abc12d78b4208 /runtime/doc/if_lua.txt | |
parent | e628c011bfb58685e4a4ce7da681afda08989a7f (diff) | |
download | rneovim-e4c2d85c7729925128746d08883286b75fb097a8.tar.gz rneovim-e4c2d85c7729925128746d08883286b75fb097a8.tar.bz2 rneovim-e4c2d85c7729925128746d08883286b75fb097a8.zip |
lua/shared: share deepcopy() with test/*
deepcopy() was duplicated in test/helpers.lua
Diffstat (limited to 'runtime/doc/if_lua.txt')
-rw-r--r-- | runtime/doc/if_lua.txt | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 32751de3a2..e7e28e041d 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -472,37 +472,52 @@ trim({s}) *vim.trim()* The string with all whitespaces trimmed from its beginning and end + + + deepcopy({orig}) *vim.deepcopy()* - Performs a deep copy of the given object, and returns that - copy. For a non-table object, that just means a usual copy of - the object, while for a table all subtables are copied - recursively. + Returns a deep copy of the given object. Non-table objects are + copied as in a typical Lua assignment, whereas table objects + are copied recursively. Parameters: ~ - {orig} Table The table to copy + {orig} Table to copy Return: ~ - A new table where the keys and values are deepcopies of - the keys and values from the original table. - + New table of copied keys and (nested) values. +tbl_contains({t}, {value}) *vim.tbl_contains()* + Checks if a list-like (vector) table contains `value` . + Parameters: ~ + {t} Table to check + {value} Value to compare -tbl_contains({t}, {value}) *vim.tbl_contains()* - TODO: Documentation + Return: ~ + true if `t` contains `value` tbl_extend({behavior}, {...}) *vim.tbl_extend()* + Merges two or more map-like tables. + Parameters: ~ {behavior} Decides what to do if a key is found in more than one map: - "error": raise an error - "keep": use value from the leftmost map - "force": use value from the rightmost map + {...} Two or more map-like tables. See also: ~ |extend()| tbl_flatten({t}) *vim.tbl_flatten()* - TODO: Documentation + Creates a copy of a list-like table such that any nested + tables are "unrolled" and appended to the result. + + Parameters: ~ + {t} List-like table + + Return: ~ + Flattened copy of the given list-like table. vim:tw=78:ts=8:ft=help:norl: |