From d5abfab2c33e006dc671a4cacdb2b332a9338a2c Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Sat, 21 Aug 2021 12:51:10 +0300 Subject: [PATCH] Rename `_G.dump()` to `_G.put()` and tweak it. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0bf9f20..727efbc 100644 --- a/README.md +++ b/README.md @@ -407,10 +407,10 @@ This list is by no means comprehensive. If you wish to know more about what's ma Writing `print(vim.inspect(x))` every time you want to inspect the contents of an object can get pretty tedious. It might be worthwhile to have a global wrapper function somewhere in your configuration: ```lua -function _G.dump(...) - local objects, v = {}, nil +function _G.put(...) + local objects = {} for i = 1, select('#', ...) do - v = select(i, ...) + local v = select(i, ...) table.insert(objects, vim.inspect(v)) end @@ -422,11 +422,11 @@ end You can then inspect the contents of an object very quickly in your code or from the command-line: ```lua -dump({1, 2, 3}) +put({1, 2, 3}) ``` ```vim -:lua dump(vim.loop) +:lua put(vim.loop) ```