findreplace: Sort last searches

This commit is contained in:
Guldoman
2022-06-23 05:16:47 +02:00
parent beefb16469
commit ec0e3018a8
+5 -2
View File
@@ -46,9 +46,12 @@ end
local function insert_unique(t, v) local function insert_unique(t, v)
local n = #t local n = #t
for i = 1, n do for i = 1, n do
if t[i] == v then return end if t[i] == v then
table.remove(t, i)
break
end end
t[n + 1] = v end
table.insert(t, 1, v)
end end