Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ body:
value: |
vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
require('lazy.nvim').setup({
require('lazy').setup({
spec = {
{
'barrett-ruth/live-server.nvim',
opts = {},
lazy = false,
},
},
})
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules/

.envrc
.direnv

.repro
repro.lua
10 changes: 8 additions & 2 deletions lua/live-server/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ local function find_cached_dir(dir)
if cur == '/' or cur:match('^[A-Z]:\\$') then
return nil
end
cur = vim.fn.fnamemodify(cur, ':h')
local parent = vim.fn.fnamemodify(cur, ':h')
if parent == cur then
return nil
end
cur = parent
end
return cur
end
Expand All @@ -156,7 +160,9 @@ end
---@return string
local function resolve_dir(dir)
if not dir or dir == '' then
dir = '%:p:h'
local bufname = vim.api.nvim_buf_get_name(0)
local uri_path = bufname:match('^%a+://(/.*)')
dir = uri_path or '%:p:h'
end
return vim.fn.expand(vim.fn.fnamemodify(vim.fn.expand(dir), ':p'))
end
Expand Down