From 67170e385f1173db8879a543133dcf6ff70bed44 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Fri, 22 Nov 2024 08:52:00 -0800 Subject: [PATCH] fix: update function call in unit tests --- lua/oil/view.lua | 6 ++---- tests/parser_spec.lua | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/oil/view.lua b/lua/oil/view.lua index 4a85bd59..74ab145a 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -745,10 +745,8 @@ M.format_entry_cols = function(entry, column_defs, col_width, adapter, is_hidden table.insert(cols, { name, (is_orphan and "OilOrphanLink" or "OilLink") .. hl_suffix }) if link_text then - table.insert( - cols, - { link_text, (is_orphan and "OilOrphanLinkTarget" or "OilLinkTarget") .. hl_suffix } - ) + local target_hl = (is_orphan and "OilOrphanLinkTarget" or "OilLinkTarget") .. hl_suffix + table.insert(cols, { link_text, target_hl }) end else table.insert(cols, { name, "OilFile" .. hl_suffix }) diff --git a/tests/parser_spec.lua b/tests/parser_spec.lua index 527e8217..9884ca1b 100644 --- a/tests/parser_spec.lua +++ b/tests/parser_spec.lua @@ -90,7 +90,7 @@ describe("parser", function() local file = test_adapter.test_set("/foo/a.txt", "file") vim.cmd.edit({ args = { "oil-test:///foo/" } }) local bufnr = vim.api.nvim_get_current_buf() - local cols = view.format_entry_cols(file, {}, {}, test_adapter) + local cols = view.format_entry_cols(file, {}, {}, test_adapter, false) local lines = util.render_table({ cols }, {}) table.insert(lines, "") table.insert(lines, " ")