From 5fc8abb727827a09d0ce1b7757d0a4c7b5802b09 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 21 Jul 2024 19:13:57 -0500 Subject: [PATCH] fix: resolve root dir if not specified --- index.html | 11 ----------- lua/live-server.lua | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index 1fdf1f3..0000000 --- a/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Document - - - - - diff --git a/lua/live-server.lua b/lua/live-server.lua index 9d875b0..4c4c1d0 100644 --- a/lua/live-server.lua +++ b/lua/live-server.lua @@ -55,7 +55,7 @@ M.setup = function(user_config) local function find_dir(args) local dir = args ~= '' and args or '%:p:h' - return vim.fn.expand(vim.fn.fnamemodify(dir, ':p')) + return vim.fn.expand(vim.fn.fnamemodify(vim.fn.expand(dir), ':p')) end vim.api.nvim_create_user_command('LiveServerStart', function(opts) @@ -65,7 +65,6 @@ M.setup = function(user_config) M.stop(find_dir(opts.args)) end, { nargs = '?' }) vim.api.nvim_create_user_command('LiveServerToggle', function(opts) - local dir = opts.args ~= '' and opts.args or '%:p:h' M.toggle(find_dir(opts.args)) end, { nargs = '?' }) end