Multi-char input in one frame is inserted as a paste (no auto-pair/indent; fixes duplicate ')' via text proxy)

This commit is contained in:
4DBug committed 2026-10-17 07:09:55 -05:00
1 parent d259901b4e
commit 79c95c7ca4
2 files changed
+36 -1

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
local RS = game:GetService("ReplicatedStorage")
local G = require(RS:WaitForChild("ImGui"))
local TextEditor = require(RS:WaitForChild("TextEditor"))(G)
local ImGui = G.ImGui
ImGui.CreateContext(); G.ImGui_ImplRoblox.Init()
local io = ImGui.GetIO()
io.DisplaySize = G.ImVec2(800, 600)
local ed = TextEditor.new()
ed:SetLanguage(TextEditor.Language.Lua())
ed:SetText("")
for f = 1, 6 do
io.DeltaTime = 1 / 60
if f == 2 then io:AddMousePosEvent(200, 100); io:AddMouseButtonEvent(0, true) end
if f == 3 then io:AddMouseButtonEvent(0, false) end
if f == 4 then for _, c in utf8.codes("local x = 1\nprint(x)\n ddd") do io:AddInputCharacter(c) end end
ImGui.NewFrame()
ImGui.SetNextWindowPos(G.ImVec2(0, 0)); ImGui.SetNextWindowSize(G.ImVec2(800, 600))
ImGui.Begin("w"); ed:Render("ed"); ImGui.End()
ImGui.Render()
end
local t = ed:GetText()
assert(t == "local x = 1\nprint(x)\n ddd\n" or t == "local x = 1\nprint(x)\n ddd", ("paste as chars: %q"):format(t))
print("OK")