#1166 validate user's options (#1177)

This commit is contained in:
Alexander Courtis
2022-04-24 19:17:05 +10:00
committed by GitHub
parent 74ae97098f
commit 5bbd3a0a91
5 changed files with 77 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ local M = {
}
function M.fn(node)
if not M.config.system_open.cmd then
if #M.config.system_open.cmd == 0 then
require("nvim-tree.utils").warn "Cannot open file with system application. Unrecognized platform."
return
end
@@ -53,7 +53,7 @@ end
function M.setup(opts)
M.config.system_open = opts or {}
if not M.config.system_open.cmd then
if #M.config.system_open.cmd == 0 then
if M.config.is_windows then
M.config.system_open = {
cmd = "cmd",