Added stylua + formatted code
This commit is contained in:
16
init.lua
16
init.lua
@@ -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
6
stylua.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
indent_width = 2
|
||||
call_parentheses = "NoSingleTable"
|
||||
collapse_simple_statement = "FunctionOnly"
|
||||
|
||||
[sort_requires]
|
||||
enabled = true
|
||||
Reference in New Issue
Block a user