From bcbc72d9c0952d30d603e48603da034b0f095e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Sterle?= Date: Tue, 6 Jul 2021 23:27:25 +0200 Subject: [PATCH] update `dump()` snippet --- README.md | 1 + doc/nvim-lua-guide.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 9b2fc1d..153a6a3 100644 --- a/README.md +++ b/README.md @@ -394,6 +394,7 @@ Writing `print(vim.inspect(x))` every time you want to inspect the contents of a function _G.dump(...) local objects = vim.tbl_map(vim.inspect, {...}) print(unpack(objects)) + return ... end ``` diff --git a/doc/nvim-lua-guide.txt b/doc/nvim-lua-guide.txt index f682d5b..ff4101a 100644 --- a/doc/nvim-lua-guide.txt +++ b/doc/nvim-lua-guide.txt @@ -488,6 +488,7 @@ have a global wrapper function somewhere in your configuration: function _G.dump(...) local objects = vim.tbl_map(vim.inspect, {...}) print(unpack(objects)) + return ... end <