diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-05 14:19:03 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-05 14:19:03 +0200 |
| commit | f5f148ad8043e6dfae1eed7f945bb2ae3fe46034 (patch) | |
| tree | d3e55149e578db63ff600e7ebb0a15f949f49508 /yazi-enter.yazi/main.lua | |
| parent | 5422942305b7ecaaa37dff922f21fd70949684b3 (diff) | |
Define Find update capability
Diffstat (limited to 'yazi-enter.yazi/main.lua')
| -rw-r--r-- | yazi-enter.yazi/main.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/yazi-enter.yazi/main.lua b/yazi-enter.yazi/main.lua index 49e3dd2..d7724ca 100644 --- a/yazi-enter.yazi/main.lua +++ b/yazi-enter.yazi/main.lua @@ -15,6 +15,8 @@ local EVENT_TYPE = "type" local EVENT_SUBMIT = "submit" local EVENT_CANCEL = "cancel" local EVENT_CLOSED = "closed" +local UPDATE_SUCCESS = "success" +local UPDATE_FAILURE = "failure" local ACCEPTED_OPTIONS = { previous = true, @@ -121,11 +123,26 @@ local commit = ya.sync(function() return 0 end) -local function new_application_boundaries(prompt_capability) +local function new_search_policy(intent) + return { + previous = intent.previous, + smart = intent.smart, + insensitive = intent.insensitive, + } +end + +local function new_application_boundaries(prompt_capability, find_update_capability) return { prompt = function(prompt_data) return prompt_capability(prompt_data) end, + find_update = function(query, search_policy) + local result, error_status = find_update_capability(query, search_policy) + if result ~= UPDATE_SUCCESS and result ~= UPDATE_FAILURE then + error("yazi-enter: Find update capability returned an invalid result", 0) + end + return result, error_status + end, } end |