Skip to content

Commit bf98d22

Browse files
authored
Update autocomplete to work when list pressed as well
1 parent 1bcac69 commit bf98d22

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

MainModule/Client/UI/Default/Console.rbxmx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,16 @@ return function(data, env)
799799
new.Parent = autoList
800800
new.Position = UDim2.new(0, 0, 0, 20 * aNum)
801801
new.MouseButton1Down:Connect(function()
802-
text.Text = text.Text..tostring(v)
802+
local args = string.split(text.Text, splitKey)
803+
args[#args] = nil
804+
805+
local textWithoutLastArg = table.concat(args, splitKey)
806+
if textWithoutLastArg ~= "" then
807+
textWithoutLastArg ..= splitKey
808+
end
809+
810+
text.Text = textWithoutLastArg .. tostring(v) .. " "
811+
text.CursorPosition = #text.Text + 1
803812
text:CaptureFocus()
804813
end)
805814

0 commit comments

Comments
 (0)