style: run stylua

This commit is contained in:
Thomas Lambert
2022-09-28 21:18:04 +02:00
parent 4e63d1f798
commit 31af52ed76

View File

@@ -1533,7 +1533,8 @@ local function PreviewImg(opts)
preview_type = "media", preview_type = "media",
attach_mappings = function(prompt_bufnr, map) attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function() actions.close(prompt_bufnr) actions.select_default:replace(function()
actions.close(prompt_bufnr)
end) end)
map("i", "<c-y>", picker_actions.yank_img_link(opts)) map("i", "<c-y>", picker_actions.yank_img_link(opts))
map("i", "<c-i>", picker_actions.paste_img_link(opts)) map("i", "<c-i>", picker_actions.paste_img_link(opts))
@@ -2721,11 +2722,13 @@ local function ToggleTodo(opts)
endline = cursorlinenr endline = cursorlinenr
end end
for curlinenr = startline, endline do for curlinenr = startline, endline do
local curline = vim.api.nvim_buf_get_lines(0, curlinenr - 1, curlinenr, false)[1] local curline =
vim.api.nvim_buf_get_lines(0, curlinenr - 1, curlinenr, false)[1]
local stripped = vim.trim(curline) local stripped = vim.trim(curline)
local repline local repline
if if
vim.startswith(stripped, "- ") and not vim.startswith(stripped, "- [") vim.startswith(stripped, "- ")
and not vim.startswith(stripped, "- [")
then then
repline = curline:gsub("%- ", "- [ ] ", 1) repline = curline:gsub("%- ", "- [ ] ", 1)
else else
@@ -2739,7 +2742,13 @@ local function ToggleTodo(opts)
end end
end end
end end
vim.api.nvim_buf_set_lines(0, curlinenr - 1, curlinenr, false, { repline }) vim.api.nvim_buf_set_lines(
0,
curlinenr - 1,
curlinenr,
false,
{ repline }
)
if opts.i then if opts.i then
vim.api.nvim_feedkeys("A", "m", false) vim.api.nvim_feedkeys("A", "m", false)
end end