From 5fb82ee1bc4f4bb83a34bcf351bcc9da55901544 Mon Sep 17 00:00:00 2001 From: ray-x Date: Mon, 4 Dec 2023 15:36:19 +1100 Subject: [PATCH] Avoid assert when tracing error msg --- lua/navigator/treesitter.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/navigator/treesitter.lua b/lua/navigator/treesitter.lua index 9ebabf7..294aaf7 100644 --- a/lua/navigator/treesitter.lua +++ b/lua/navigator/treesitter.lua @@ -109,7 +109,10 @@ function M.find_definition(range, bufnr) if definition then -- stylua: ignore start - trace( 'error: def not found in ', bufnr, definition:range(), definition:type(), definition:parent():type()) + trace( 'error: def not found in ', bufnr, definition:range(), definition:type()) + if definition:parent() then + trace("def not found", definition:parent():type()) + end -- stylua: ignore end end end