tangled
alpha
login
or
join now
robinwobin.dev
/
artio.nvim
3
fork
atom
minimal extui fuzzy finder for neovim
3
fork
atom
overview
issues
pulls
pipelines
feat(picker): free pickers after use
robinwobin.dev
3 months ago
8bad5623
35f0007b
+21
-3
1 changed file
expand all
collapse all
unified
split
lua
artio
picker.lua
+21
-3
lua/artio/picker.lua
···
66
66
}
67
67
68
68
function Picker:open()
69
69
-
if Picker.active_picker then
70
70
-
Picker.active_picker:close()
69
69
+
if Picker.active_picker and Picker.active_picker ~= self then
70
70
+
Picker.active_picker:close(true)
71
71
end
72
72
Picker.active_picker = self
73
73
···
102
102
end)()
103
103
end
104
104
105
105
-
function Picker:close()
105
105
+
---@param free? boolean
106
106
+
function Picker:close(free)
106
107
if self.closed then
107
108
return
108
109
end
···
114
115
self:delkeymaps()
115
116
116
117
self.closed = true
118
118
+
119
119
+
if free then
120
120
+
self:free()
121
121
+
end
122
122
+
end
123
123
+
124
124
+
function Picker:free()
125
125
+
if self == nil then
126
126
+
return
127
127
+
end
128
128
+
self.items = nil
129
129
+
self.matches = nil
130
130
+
self.marked = nil
131
131
+
self = nil
132
132
+
vim.schedule(function()
133
133
+
collectgarbage("collect")
134
134
+
end)
117
135
end
118
136
119
137
function Picker:initkeymaps()