Skip to content

Commit

Permalink
Format Lua files with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 18, 2025
1 parent 74ce106 commit 8504013
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions plugin/livepreview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,11 @@ api.nvim_create_user_command(cmd, function(cmd_opts)
end
filepath = fs.normalize(filepath)
lp.start(filepath, Config.port)
local urlpath =
(Config.dynamic_root
and fs.basename(filepath)
or utils.get_relative_path(filepath, fs.normalize(vim.uv.cwd() or "")))
:gsub(" ", "%%20")
utils.open_browser(
("http://localhost:%d/%s"):format(
Config.port,
urlpath
),
Config.browser
)
local urlpath = (Config.dynamic_root and fs.basename(filepath) or utils.get_relative_path(
filepath,
fs.normalize(vim.uv.cwd() or "")
)):gsub(" ", "%%20")
utils.open_browser(("http://localhost:%d/%s"):format(Config.port, urlpath), Config.browser)
elseif subcommand == "close" then
lp.close()
print("Live preview stopped")
Expand Down

0 comments on commit 8504013

Please sign in to comment.