@rbxts/centurion-ui 1.0.0-dev-dd918ea → 1.0.0-dev-ecb0e98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
+
local splitString = TS.import(script, TS.getModule(script, "@rbxts", "centurion").out.shared.util.string).splitString
|
|
3
4
|
local subscribe = TS.import(script, TS.getModule(script, "@rbxts", "charm").src).subscribe
|
|
4
5
|
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
5
6
|
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
@@ -173,8 +174,8 @@ local function TerminalTextField(_param)
|
|
|
173
174
|
end
|
|
174
175
|
local currentText = textBox.Text
|
|
175
176
|
local textParts = terminalTextParts()
|
|
176
|
-
local lastPart = textParts[#textParts]
|
|
177
177
|
local atNextPart = string.sub(currentText, -1) == " "
|
|
178
|
+
local lastPart = if not atNextPart then textParts[#textParts] else nil
|
|
178
179
|
if commandPath == nil then
|
|
179
180
|
local suggestionTitle = suggestion.title
|
|
180
181
|
if #textParts == 0 then
|
|
@@ -188,7 +189,7 @@ local function TerminalTextField(_param)
|
|
|
188
189
|
if atNextPart then
|
|
189
190
|
newText ..= suggestionTitle
|
|
190
191
|
table.insert(pathParts, suggestionTitle)
|
|
191
|
-
elseif
|
|
192
|
+
elseif lastPart ~= nil then
|
|
192
193
|
local _newText = newText
|
|
193
194
|
local _arg1 = #newText - #lastPart
|
|
194
195
|
newText = string.sub(_newText, 0, _arg1) .. suggestionTitle
|
|
@@ -254,24 +255,13 @@ local function TerminalTextField(_param)
|
|
|
254
255
|
return nil
|
|
255
256
|
end
|
|
256
257
|
local newText = currentText
|
|
257
|
-
local
|
|
258
|
-
local
|
|
258
|
+
local parts = splitString(newText, " ", true)
|
|
259
|
+
local currentPart = parts[#parts]
|
|
260
|
+
local currentPartSize = if currentTextPart() ~= nil then #currentPart else 0
|
|
259
261
|
local _newText = newText
|
|
260
|
-
local
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
_condition_2 = 0
|
|
264
|
-
end
|
|
265
|
-
local _exp_1 = _exp - _condition_2
|
|
266
|
-
local _result = trailingSpaces
|
|
267
|
-
if _result ~= nil then
|
|
268
|
-
_result = #_result
|
|
269
|
-
end
|
|
270
|
-
local _condition_3 = _result
|
|
271
|
-
if _condition_3 == nil then
|
|
272
|
-
_condition_3 = 0
|
|
273
|
-
end
|
|
274
|
-
newText = string.sub(_newText, 0, _exp_1 - _condition_3)
|
|
262
|
+
local _arg1 = #newText - currentPartSize
|
|
263
|
+
newText = string.sub(_newText, 0, _arg1)
|
|
264
|
+
local otherSuggestion = suggestion.others[1]
|
|
275
265
|
newText ..= if #{ string.match(otherSuggestion, "%s") } == 0 then otherSuggestion else `"{otherSuggestion}"`
|
|
276
266
|
if argIndex < #commandArgs - 1 then
|
|
277
267
|
newText ..= " "
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/centurion-ui",
|
|
3
3
|
"description": "Terminal UI for the Centurion command framework",
|
|
4
|
-
"version": "1.0.0-dev-
|
|
4
|
+
"version": "1.0.0-dev-ecb0e98",
|
|
5
5
|
"author": "paradoxuum",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "out/init.lua",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "shx rm -rf out && rbxtsc -w"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@rbxts/centurion": "^1.0.0-dev-
|
|
35
|
+
"@rbxts/centurion": "^1.0.0-dev-ecb0e98",
|
|
36
36
|
"@rbxts/compiler-types": "3.0.0-types.0",
|
|
37
37
|
"@rbxts/types": "^1.0.799",
|
|
38
38
|
"roblox-ts": "3.0.0",
|