summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:41:06 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:41:06 +0200
commit70bc720156f8ff315fcf54f478becfdf098f3994 (patch)
tree4964af822d39d9485e10f802b73199e971f8af76 /lua
parent69000b4e6acf9ecad0d3d9220bca6c1433993d6c (diff)
Detect cross-line feedback migration
Diffstat (limited to 'lua')
-rw-r--r--lua/clever_f/feedback_service.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/clever_f/feedback_service.lua b/lua/clever_f/feedback_service.lua
index 6972d70..e553cd7 100644
--- a/lua/clever_f/feedback_service.lua
+++ b/lua/clever_f/feedback_service.lua
@@ -25,6 +25,10 @@ M.FinalizerAction = {
PRESERVE = "preserve",
FINALIZE = "finalize",
}
+M.MigrationReason = {
+ LINE_CHANGE = "line_change",
+ TILL_DIRECTION_CHANGE = "till_direction_change",
+}
local OVERLAY_PRIORITIES = {
CleverFCursor = M.Priority.HIGH,
@@ -603,6 +607,28 @@ function FeedbackService:persistent_requests()
return result
end
+function M.command_migration_reason(request)
+ if type(request) ~= "table" then
+ fail("command feedback migration request must be a table", 2)
+ end
+ local origin = domain.Position.coerce(request.origin)
+ local destination = domain.Position.coerce(request.destination)
+ if request.outcome ~= nil and request.outcome.complete ~= true then
+ return nil
+ end
+ if origin.line ~= destination.line then
+ return M.MigrationReason.LINE_CHANGE
+ end
+ return nil
+end
+
+function FeedbackService:migrate_command(request)
+ return {
+ migrated = false,
+ reason = M.command_migration_reason(request),
+ }
+end
+
function FeedbackService:evaluate_feature_links()
local record = service_records[self]
local rules = record.policy:evaluate_highlight_links()