Не так вставлял

This commit is contained in:
Oleshe 2025-05-25 22:12:31 +03:00 committed by GitHub
parent b8727e8de3
commit c37a692a77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3064,9 +3064,11 @@ local function inputEventHandler(workspace, input, e1, e2, e3, e4, e5, e6, ...)
input:setCursorPosition(unicode.len(input.text) + 1)
-- V
elseif e4 == 47 and type(clipboard.paste()) ~= "table" and clipboard.paste() ~= nil then
input.text = input.text .. tostring(clipboard.paste())
input:setCursorPosition(unicode.len(input.text)+1)
elseif e4 == 47 and type(clipboard.paste()) ~= "table" and clipboard.paste() ~= nil then
local startPos = input.cursorPosition
local toPaste = tostring(clipboard.paste())
input.text = unicode.sub(input.text, 1,startPos) .. toPaste .. unicode.sub(input.text, startPos, unicode.len(input.text))
input:setCursorPosition(startPos + unicode.len(toPaste)+1)
else
local char = unicode.char(e3)