mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 02:59:20 +01:00
23 lines
435 B
Lua
23 lines
435 B
Lua
local Clipboard = {
|
|
maxHistory = 2,
|
|
history = {}
|
|
}
|
|
|
|
function Clipboard.copy(content)
|
|
table.insert(Clipboard.history,1,content)
|
|
while #Clipboard.history > Clipboard.maxHistory do
|
|
table.remove(Clipboard.history, Clipboard.maxHistory + 1)
|
|
end
|
|
end
|
|
|
|
function Clipboard.paste()
|
|
return Clipboard.history[1]
|
|
end
|
|
|
|
function Clipboard.clear()
|
|
Clipboard.history = {}
|
|
return true
|
|
end
|
|
|
|
return Clipboard
|