summaryrefslogtreecommitdiff
path: root/lua/clever_f/domain.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/clever_f/domain.lua')
-rw-r--r--lua/clever_f/domain.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/clever_f/domain.lua b/lua/clever_f/domain.lua
index a5b8d39..6a40092 100644
--- a/lua/clever_f/domain.lua
+++ b/lua/clever_f/domain.lua
@@ -987,6 +987,14 @@ function TargetPlan:matches(...)
return self.matcher(...)
end
+function TargetPlan:matches_at(text_view, position)
+ if type(text_view) ~= "table" or type(text_view.character_at) ~= "function" then
+ fail("target plan match requires a text view", 2)
+ end
+ position = Position.coerce(position)
+ return self.matcher(text_view:character_at(position), position, text_view)
+end
+
function TargetPlan:to_table()
return {
target = self.target:to_table(),