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)
|
end)
|
||||||
|
|
||||||
local all_bookmarks = ya.sync(function(state)
|
local all_bookmarks = ya.sync(function(state) return state.bookmarks or {} end)
|
||||||
return state.bookmarks or {}
|
|
||||||
end)
|
|
||||||
|
|
||||||
local delete_bookmark = ya.sync(function(state, idx)
|
local delete_bookmark = ya.sync(function(state, idx) table.remove(state.bookmarks, idx) end)
|
||||||
table.remove(state.bookmarks, idx)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local delete_all_bookmarks = ya.sync(function(state)
|
local delete_all_bookmarks = ya.sync(function(state) state.bookmarks = nil end)
|
||||||
state.bookmarks = nil
|
|
||||||
end)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entry = function(_, args)
|
entry = function(_, args)
|
||||||
@@ -45,7 +39,7 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if action == "save" then
|
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
|
if key then
|
||||||
save_bookmark(key)
|
save_bookmark(key)
|
||||||
end
|
end
|
||||||
@@ -57,7 +51,7 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
local bookmarks = all_bookmarks()
|
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
|
if not selected then
|
||||||
return
|
return
|
||||||
end
|
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