Permalink
Browse files

Improved autocompletion for set.lua

If a setting is boolean, set.lua will now complete true or false.
  • Loading branch information...
Wilma456 committed Oct 4, 2017
1 parent 19e4c03 commit 97b41abf51c01d17f955925647547425ff56c84b
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/main/resources/assets/computercraft/lua/rom/startup.lua
@@ -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

0 comments on commit 97b41ab

Please sign in to comment.