lint: apply stylua
This commit is contained in:
parent
126a8a2346
commit
57db10d748
2 changed files with 17 additions and 17 deletions
|
|
@ -208,7 +208,7 @@ end
|
||||||
M.normalize_url = function(url, callback)
|
M.normalize_url = function(url, callback)
|
||||||
local scheme, path = util.parse_url(url)
|
local scheme, path = util.parse_url(url)
|
||||||
assert(path)
|
assert(path)
|
||||||
if fs.is_windows and path == '/' then
|
if fs.is_windows and path == "/" then
|
||||||
return callback(url)
|
return callback(url)
|
||||||
end
|
end
|
||||||
local os_path = vim.fn.fnamemodify(fs.posix_to_os_path(path), ":p")
|
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 function list_windows_drives(url, column_defs, cb)
|
||||||
local fetch_meta = columns.get_metadata_fetcher(M, column_defs)
|
local fetch_meta = columns.get_metadata_fetcher(M, column_defs)
|
||||||
local stdout = ""
|
local stdout = ""
|
||||||
local jid = vim.fn.jobstart({ 'wmic', 'logicaldisk', 'get', 'name' }, {
|
local jid = vim.fn.jobstart({ "wmic", "logicaldisk", "get", "name" }, {
|
||||||
stdout_buffered = true,
|
stdout_buffered = true,
|
||||||
on_stdout = function(_, data)
|
on_stdout = function(_, data)
|
||||||
stdout = table.concat(data, '\n')
|
stdout = table.concat(data, "\n")
|
||||||
end,
|
end,
|
||||||
on_exit = function(_, code)
|
on_exit = function(_, code)
|
||||||
if code ~= 0 then
|
if code ~= 0 then
|
||||||
return cb("Error listing windows devices")
|
return cb("Error listing windows devices")
|
||||||
end
|
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
|
-- Remove the "Name" header
|
||||||
table.remove(lines, 1)
|
table.remove(lines, 1)
|
||||||
local internal_entries = {}
|
local internal_entries = {}
|
||||||
|
|
@ -301,7 +301,7 @@ local function list_windows_drives(url, column_defs, cb)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
if jid <= 0 then
|
if jid <= 0 then
|
||||||
cb("Could not list windows devices")
|
cb("Could not list windows devices")
|
||||||
|
|
@ -314,7 +314,7 @@ end
|
||||||
M.list = function(url, column_defs, cb)
|
M.list = function(url, column_defs, cb)
|
||||||
local _, path = util.parse_url(url)
|
local _, path = util.parse_url(url)
|
||||||
assert(path)
|
assert(path)
|
||||||
if fs.is_windows and path == '/' then
|
if fs.is_windows and path == "/" then
|
||||||
return list_windows_drives(url, column_defs, cb)
|
return list_windows_drives(url, column_defs, cb)
|
||||||
end
|
end
|
||||||
local dir = fs.posix_to_os_path(path)
|
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 bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
local _, path = util.parse_url(bufname)
|
local _, path = util.parse_url(bufname)
|
||||||
assert(path)
|
assert(path)
|
||||||
if fs.is_windows and path == '/' then
|
if fs.is_windows and path == "/" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local dir = fs.posix_to_os_path(path)
|
local dir = fs.posix_to_os_path(path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue