From 826683b1bfd704f4691bc7522411672a9cae5059 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Mon, 5 Apr 2021 14:40:22 +0200 Subject: Fix: allow empty path in utils.get_at_path --- lua/nvim-treesitter/utils.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'lua/nvim-treesitter/utils.lua') diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index ab8498b0..1d2bb22c 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -111,6 +111,7 @@ end -- @param path the '.' separated path -- @returns the value at path or nil function M.get_at_path(tbl, path) + if path == '' then return tbl end local segments = vim.split(path, '.', true) local result = tbl -- cgit v1.2.3