lint: apply stylua

This commit is contained in:
Steven Arcangeli 2023-11-05 07:29:15 -08:00
parent 126a8a2346
commit 57db10d748
2 changed files with 17 additions and 17 deletions

View file

@ -208,7 +208,7 @@ end
M.normalize_url = function(url, callback)
local scheme, path = util.parse_url(url)
assert(path)
if fs.is_windows and path == '/' then
if fs.is_windows and path == "/" then
return callback(url)
end
local os_path = vim.fn.fnamemodify(fs.posix_to_os_path(path), ":p")
@ -263,16 +263,16 @@ end
local function list_windows_drives(url, column_defs, cb)
local fetch_meta = columns.get_metadata_fetcher(M, column_defs)
local stdout = ""
local jid = vim.fn.jobstart({ 'wmic', 'logicaldisk', 'get', 'name' }, {
local jid = vim.fn.jobstart({ "wmic", "logicaldisk", "get", "name" }, {
stdout_buffered = true,
on_stdout = function(_, data)
stdout = table.concat(data, '\n')
stdout = table.concat(data, "\n")
end,
on_exit = function(_, code)
if code ~= 0 then
return cb("Error listing windows devices")
end
local lines = vim.split(stdout, '\n', { plain = true, trimempty = true })
local lines = vim.split(stdout, "\n", { plain = true, trimempty = true })
-- Remove the "Name" header
table.remove(lines, 1)
local internal_entries = {}
@ -301,7 +301,7 @@ local function list_windows_drives(url, column_defs, cb)
end)
end
end
end
end,
})
if jid <= 0 then
cb("Could not list windows devices")
@ -314,7 +314,7 @@ end
M.list = function(url, column_defs, cb)
local _, path = util.parse_url(url)
assert(path)
if fs.is_windows and path == '/' then
if fs.is_windows and path == "/" then
return list_windows_drives(url, column_defs, cb)
end
local dir = fs.posix_to_os_path(path)
@ -395,7 +395,7 @@ M.is_modifiable = function(bufnr)
local bufname = vim.api.nvim_buf_get_name(bufnr)
local _, path = util.parse_url(bufname)
assert(path)
if fs.is_windows and path == '/' then
if fs.is_windows and path == "/" then
return false
end
local dir = fs.posix_to_os_path(path)

View file

@ -533,12 +533,12 @@ M.select = function(opts, callback)
local child = dir .. entry.name
local url = scheme .. child
local is_directory = entry.type == "directory"
or (
entry.type == "link"
and entry.meta
and entry.meta.link_stat
and entry.meta.link_stat.type == "directory"
)
or (
entry.type == "link"
and entry.meta
and entry.meta.link_stat
and entry.meta.link_stat.type == "directory"
)
if is_directory then
url = url .. "/"
-- If this is a new directory BUT we think we already have an entry with this name, disallow
@ -623,9 +623,9 @@ M.select = function(opts, callback)
return finish(err)
end
if
opts.close
and vim.api.nvim_win_is_valid(prev_win)
and prev_win ~= vim.api.nvim_get_current_win()
opts.close
and vim.api.nvim_win_is_valid(prev_win)
and prev_win ~= vim.api.nvim_get_current_win()
then
vim.api.nvim_win_call(prev_win, function()
M.close()
@ -758,7 +758,7 @@ local function restore_alt_buf()
-- If we are editing the same buffer that we started oil from, set the alternate to be
-- what it was before we opened oil
local has_orig_alt, alt_buffer =
pcall(vim.api.nvim_win_get_var, 0, "oil_original_alternate")
pcall(vim.api.nvim_win_get_var, 0, "oil_original_alternate")
if has_orig_alt and vim.api.nvim_buf_is_valid(alt_buffer) then
vim.fn.setreg("#", alt_buffer)
end