Skip to content

Commit

Permalink
Format Lua files with stylua
Browse files Browse the repository at this point in the history
update

update
  • Loading branch information
github-actions[bot] authored and brianhuster committed Feb 2, 2025
1 parent c8442ea commit e527bbf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lua/livepreview/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ M.pickers = {
telescope = "telescope",
fzflua = "fzf-lua",
minipick = "mini.pick",
default = ""
default = "",
}

---@class LivePreviewConfig
Expand Down
2 changes: 1 addition & 1 deletion lua/livepreview/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function M.start(filepath, port)
M.serverObj:start("127.0.0.1", port, {
on_events = utils.supported_filetype(filepath) == "html"
and {
---@param client userdata
---@param client uv_tcp_t
---@param data {filename: string, event: FsEvent}
LivePreviewDirChanged = function(client, data)
if not vim.regex([[\.\(html\|css\|js\)$]]):match_str(data.filename) then
Expand Down
2 changes: 0 additions & 2 deletions lua/livepreview/server/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ function Server:start(ip, port, opts)
table.insert(M.connecting_clients, client)
end)

print("Server listening on port " .. port)
print("Webroot: " .. self.webroot)
uv.run()
end

Expand Down
4 changes: 1 addition & 3 deletions lua/livepreview/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ end
---@param val string
---@return string: SHA1 hash
function M.sha1(val)
local bit = require("bit")
local bit = bit or require("bit")

local function to_32_bits_str(number)
return string.char(bit.band(bit.rshift(number, 24), 255))
Expand Down Expand Up @@ -287,8 +287,6 @@ function M.processes_listening_on_port(port)
]]):format(port)
end
local cmd_result = M.await_term_cmd(cmd)
print(cmd)
vim.print(cmd_result)
if not cmd_result then
print("Error getting processes listening on port " .. port)
return {}
Expand Down
4 changes: 3 additions & 1 deletion plugin/livepreview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ api.nvim_create_user_command(cmd, function(cmd_opts)
filepath,
fs.normalize(vim.uv.cwd() or "")
)):gsub(" ", "%%20")
utils.open_browser(("http://localhost:%d/%s"):format(Config.port, urlpath), Config.browser)
local url = ("http://localhost:%d/%s"):format(Config.port, urlpath)
print("live-preview.nvim: Opening browser at " .. url)
utils.open_browser(url, Config.browser)
elseif subcommand == "close" then
lp.close()
print("Live preview stopped")
Expand Down

0 comments on commit e527bbf

Please sign in to comment.