refactor: format tables line by line for better readability (#2456)

* Format tables line by line for better readability

* Forgot a comma

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Azad
2023-10-14 09:07:28 +02:00
committed by GitHub
parent e64a498a5e
commit 4054fc4be3
13 changed files with 117 additions and 22 deletions

View File

@@ -105,8 +105,14 @@ local function do_single_paste(source, dest, action_type, action_fn)
end
if dest_stats then
local input_opts = {
prompt = "Rename to ",
default = dest,
completion = "dir",
}
if source == dest then
vim.ui.input({ prompt = "Rename to ", default = dest, completion = "dir" }, function(new_dest)
vim.ui.input(input_opts, function(new_dest)
utils.clear_prompt()
if new_dest then
do_single_paste(source, new_dest, action_type, action_fn)
@@ -120,7 +126,7 @@ local function do_single_paste(source, dest, action_type, action_fn)
if item_short == "y" then
on_process()
elseif item_short == "" or item_short == "r" then
vim.ui.input({ prompt = "Rename to ", default = dest, completion = "dir" }, function(new_dest)
vim.ui.input(input_opts, function(new_dest)
utils.clear_prompt()
if new_dest then
do_single_paste(source, new_dest, action_type, action_fn)

View File

@@ -47,7 +47,11 @@ function M.fn(node)
local containing_folder = get_containing_folder(node)
local input_opts = { prompt = "Create file ", default = containing_folder, completion = "file" }
local input_opts = {
prompt = "Create file ",
default = containing_folder,
completion = "file",
}
vim.ui.input(input_opts, function(new_file_path)
utils.clear_prompt()

View File

@@ -77,7 +77,11 @@ function M.fn(default_modifier)
default_path = default_path .. "/"
end
local input_opts = { prompt = "Rename to ", default = default_path, completion = "file" }
local input_opts = {
prompt = "Rename to ",
default = default_path,
completion = "file",
}
vim.ui.input(input_opts, function(new_file_path)
utils.clear_prompt()

View File

@@ -17,7 +17,11 @@ function M.fn(node)
}
table.insert(process.args, node.link_to or node.absolute_path)
local opts = { args = process.args, stdio = { nil, nil, process.stderr }, detached = true }
local opts = {
args = process.args,
stdio = { nil, nil, process.stderr },
detached = true,
}
process.handle, process.pid = vim.loop.spawn(process.cmd, opts, function(code)
process.stderr:read_stop()

View File

@@ -29,7 +29,11 @@ function M.fn(opts)
view.focus()
else
-- open
lib.open { path = opts.path, current_window = opts.current_window, winid = opts.winid }
lib.open {
path = opts.path,
current_window = opts.current_window,
winid = opts.winid,
}
end
-- find file

View File

@@ -45,7 +45,11 @@ function M.fn(opts, no_focus, cwd, bang)
view.close()
else
-- open
lib.open { path = opts.path, current_window = opts.current_window, winid = opts.winid }
lib.open {
path = opts.path,
current_window = opts.current_window,
winid = opts.winid,
}
-- find file
if M.config.update_focused_file.enable or opts.find_file then