Skip to content

Commit

Permalink
Improved autocompletion for set.lua
Browse files Browse the repository at this point in the history
If a setting is boolean, set.lua will now complete true or false.
  • Loading branch information
JakobDev committed Oct 4, 2017
1 parent 19e4c03 commit 97b41ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/resources/assets/computercraft/lua/rom/startup.lua
Expand Up @@ -163,9 +163,14 @@ local function completeChat( shell, nIndex, sText, tPreviousText )
return completeMultipleChoice( sText, tChatOptions )
end
end
local tBoolean = { "true", "false" }
local function completeSet( shell, nIndex, sText, tPreviousText )
if nIndex == 1 then
return completeMultipleChoice( sText, settings.getNames(), true )
elseif nIndex == 2 then
if type( settings.get ( tPreviousText[2] ) )== "boolean" then
return completeMultipleChoice( sText, tBoolean )
end
end
end
local tCommands
Expand Down

0 comments on commit 97b41ab

Please sign in to comment.