Added stylua + formatted code

This commit is contained in:
Diogo Duarte
2024-03-12 13:27:04 +00:00
parent c067c08211
commit eebc8644b0
2 changed files with 11 additions and 11 deletions

View File

@@ -25,17 +25,11 @@ local save_bookmark = ya.sync(function(state, idx)
}
end)
local all_bookmarks = ya.sync(function(state)
return state.bookmarks or {}
end)
local all_bookmarks = ya.sync(function(state) return state.bookmarks or {} end)
local delete_bookmark = ya.sync(function(state, idx)
table.remove(state.bookmarks, idx)
end)
local delete_bookmark = ya.sync(function(state, idx) table.remove(state.bookmarks, idx) end)
local delete_all_bookmarks = ya.sync(function(state)
state.bookmarks = nil
end)
local delete_all_bookmarks = ya.sync(function(state) state.bookmarks = nil end)
return {
entry = function(_, args)
@@ -45,7 +39,7 @@ return {
end
if action == "save" then
local key = ya.which({ cands = SUPPORTED_KEYS, silent = true })
local key = ya.which { cands = SUPPORTED_KEYS, silent = true }
if key then
save_bookmark(key)
end
@@ -57,7 +51,7 @@ return {
end
local bookmarks = all_bookmarks()
local selected = #bookmarks > 0 and ya.which({ cands = bookmarks })
local selected = #bookmarks > 0 and ya.which { cands = bookmarks }
if not selected then
return
end

6
stylua.toml Normal file
View File

@@ -0,0 +1,6 @@
indent_width = 2
call_parentheses = "NoSingleTable"
collapse_simple_statement = "FunctionOnly"
[sort_requires]
enabled = true