feat: support dot in jump-to-char.yazi

This commit is contained in:
sxyazi
2024-06-18 18:19:12 +08:00
parent ef57d99f64
commit 6d54340f48

View File

@@ -1,11 +1,13 @@
local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."
local changed = ya.sync(function(st, new)
local b = st.last ~= new
st.last = new
return b
return b or not cx.active.finder
end)
local escape = function(s) return s == "." and "\\." or s end
return {
entry = function()
local cands = {}
@@ -18,8 +20,9 @@ return {
return
end
if changed(cands[idx].on) then
ya.manager_emit("find_do", { "^" .. cands[idx].on })
local kw = escape(cands[idx].on)
if changed(kw) then
ya.manager_emit("find_do", { "^" .. kw })
else
ya.manager_emit("find_arrow", {})
end