mirror of
https://github.com/RGBCube/random-scripts
synced 2025-05-14 02:54:58 +00:00
feat: entry separator
This commit is contained in:
parent
ac84d03222
commit
23e3553405
1 changed files with 3 additions and 1 deletions
|
@ -4,6 +4,8 @@ local location = "lalamo.txt"
|
||||||
local modifier = {"cmd", "ctrl"}
|
local modifier = {"cmd", "ctrl"}
|
||||||
-- The key after the modifiers nescessary to trigger the prompt.
|
-- The key after the modifiers nescessary to trigger the prompt.
|
||||||
local key = "p"
|
local key = "p"
|
||||||
|
-- The separator used to split entries in the location.
|
||||||
|
local entry_separator = "%%%"
|
||||||
|
|
||||||
_G.hs = _G.hs or {}
|
_G.hs = _G.hs or {}
|
||||||
|
|
||||||
|
@ -61,7 +63,7 @@ local fuzzySearch = function()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local entries = split(content, "%%%", true)
|
local entries = split(content, entry_separator, true)
|
||||||
|
|
||||||
if #entries == 0 then
|
if #entries == 0 then
|
||||||
hs.alert.show("~/" .. location .. " is empty")
|
hs.alert.show("~/" .. location .. " is empty")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue