From a95458e1e302058c74935f1bcbb5fd615bb9df3c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 23:38:04 +0100 Subject: [PATCH] fix: use lazy's util.open instead --- lua/lazyvim/plugins/editor.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index be9f3e51..7a943cfc 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -69,16 +69,12 @@ return { end, desc = "copy path to clipboard", }, - ["O"] = vim.ui.open and { + ["O"] = { function(state) - local path = state.tree:get_node().path - local ret = vim.ui.open(path) - if ret and ret.code ~= 0 then - require("lazyvim.util").error("Failed to open file: " .. ret.stderr .. "\n .. " .. ret.stdout) - end + require("lazy.util").open(state.tree:get_node().path, { system = true }) end, - desc = "open with system default application", - } or nil, + desc = "open with system application", + }, }, }, default_component_configs = {