Skip to content

Commit

Permalink
chore: autoformat with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro authored and github-actions[bot] committed Feb 22, 2024
1 parent c3afe21 commit fab9f1b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 58 deletions.
18 changes: 7 additions & 11 deletions lua/neorg/modules/core/clipboard/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,13 @@ module.load = function()

return callback.cb(
node,
vim.split(
assert(register --[[@as string]]),
"\n",
{
plain = true,
-- TODO: This causes problems in places
-- where you actually want to copy
-- newlines.
trimempty = true,
}
),
vim.split(assert(register --[[@as string]]), "\n", {
plain = true,
-- TODO: This causes problems in places
-- where you actually want to copy
-- newlines.
trimempty = true,
}),
{
start = range[1],
["end"] = range[2],
Expand Down
58 changes: 20 additions & 38 deletions lua/neorg/modules/core/export/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,16 @@ module.on_event = function(event)
local filetype = event.content[2] or vim.filetype.match({ filename = filepath })
local exported = module.public.export(event.buffer, filetype)

vim.loop.fs_open(
filepath,
"w",
438,
function(err, fd)
assert(not err, lib.lazy_string_concat("Failed to open file '", filepath, "' for export: ", err))
assert(fd)

vim.loop.fs_write(
fd,
exported,
0,
function(werr)
assert(
not werr,
lib.lazy_string_concat("Failed to write to file '", filepath, "' for export: ", werr)
)
end
)
vim.loop.fs_open(filepath, "w", 438, function(err, fd)
assert(not err, lib.lazy_string_concat("Failed to open file '", filepath, "' for export: ", err))
assert(fd)

vim.schedule(lib.wrap(utils.notify, "Successfully exported 1 file!"))
end
)
vim.loop.fs_write(fd, exported, 0, function(werr)
assert(not werr, lib.lazy_string_concat("Failed to write to file '", filepath, "' for export: ", werr))
end)

vim.schedule(lib.wrap(utils.notify, "Successfully exported 1 file!"))
end)
elseif event.type == "core.neorgcmd.events.export.directory" then
local path = event.content[3] and vim.fn.expand(event.content[3])
or module.config.public.export_dir
Expand Down Expand Up @@ -312,24 +299,19 @@ module.on_event = function(event)
)
assert(fd)

vim.loop.fs_write(
fd,
exported,
0,
function(werr)
assert(
not werr,
lib.lazy_string_concat(
"Failed to write to file '",
write_path,
"' for export: ",
werr
)
vim.loop.fs_write(fd, exported, 0, function(werr)
assert(
not werr,
lib.lazy_string_concat(
"Failed to write to file '",
write_path,
"' for export: ",
werr
)
)

check_counters()
end
)
check_counters()
end)
end)
end)
end
Expand Down
9 changes: 3 additions & 6 deletions lua/neorg/modules/core/keybinds/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ module.load = function()
module.required["core.autocommands"].enable_autocommand("BufLeave")

if module.config.public.hook then
neorg.callbacks.on_event(
"core.keybinds.events.enable_keybinds",
function(_, keybinds)
module.config.public.hook(keybinds)
end
)
neorg.callbacks.on_event("core.keybinds.events.enable_keybinds", function(_, keybinds)
module.config.public.hook(keybinds)
end)
end
end

Expand Down
3 changes: 1 addition & 2 deletions lua/neorg/modules/core/ui/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ module.examples = {
local buffer = module.public.create_split("selection/Test selection")

-- Binds a selection to that buffer
local selection = module
.public
local selection = module.public
.begin_selection(buffer)
:apply({
-- A title will simply be text with a custom highlight
Expand Down
4 changes: 3 additions & 1 deletion lua/neorg/modules/core/upgrade/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ local log, modules = neorg.log, neorg.modules
local module = modules.create("core.upgrade")

module.setup = function()
log.error("The `core.upgrade` module has been deprecated and is no longer in use. Please remove it from your loaded list.")
log.error(
"The `core.upgrade` module has been deprecated and is no longer in use. Please remove it from your loaded list."
)

return {
success = false,
Expand Down

0 comments on commit fab9f1b

Please sign in to comment.