From 48d807a0a1eb1e9e81b1c87c86a66d97ab5c5889 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 4 May 2024 11:40:50 -0700 Subject: [PATCH] Cleanup --- lua/argonaut/types.lua | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lua/argonaut/types.lua b/lua/argonaut/types.lua index 3be41e1..8c5de15 100644 --- a/lua/argonaut/types.lua +++ b/lua/argonaut/types.lua @@ -236,7 +236,6 @@ function Param.new(pair, opt) offset = nil, start = nil, stop = nil, - terminator = nil, } return setmetatable(param, Param) @@ -259,13 +258,6 @@ function Param:append(char, cursor) self.stop = cursor end -function Param:terminate(cursor) - self.terminator = cursor - if self.terminator == Cursor.get_current() then - self.offset = #self.text - end -end - function Param:is_active() return self.offset ~= nil end @@ -342,12 +334,8 @@ function ParamList.new(range, opt) return setmetatable(params, ParamList) end -function ParamList:flush(cursor) +function ParamList:flush() if self.current then - if cursor then - self.current:terminate(cursor) - end - if self.current:trim() then table.insert(self.parsed, self.current) end @@ -360,7 +348,7 @@ function ParamList:update(char, brace_stack, cursor) if not cursor:is_literal() then brace_stack:update(char) if brace_stack:empty() and char == ',' then - self:flush(cursor) + self:flush() return end end @@ -646,11 +634,7 @@ function WrapContext:object_a() if param then param.start:set_current() vim.cmd.normal('v') - if param.terminator then - param.terminator:set_current() - else - param.stop:set_current() - end + param.stop:set_current() end end