1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 14:43:22 +00:00

Add setting for .lua extension (#278)

* Add setting for .lua extension

* Feedback  from SquidDev

* Feedback from dan200

* All requested changes are done

* Better description

* Cleaner check
This commit is contained in:
Wilma456 2017-05-29 14:21:27 +02:00 committed by Daniel Ratcliffe
parent 54d202cf6b
commit 99b5534099
3 changed files with 7 additions and 2 deletions

View File

@ -817,7 +817,8 @@ end
settings.set( "shell.allow_startup", true )
settings.set( "shell.allow_disk_startup", (commands == nil) )
settings.set( "shell.autocomplete", true )
settings.set( "edit.autocomplete", true )
settings.set( "edit.autocomplete", true )
settings.set( "edit.default_extension", "lua" )
settings.set( "lua.autocomplete", true )
settings.set( "list.show_hidden", false )
if term.isColour() then

View File

@ -11,6 +11,7 @@ Default Settings:
shell.autocomplete - enables auto-completion in the Shell.
lua.autocomplete - enables auto-completion in the Lua program.
edit.autocomplete - enables auto-completion in the Edit program.
edit.default_extension - sets the default file extension for files created with the Edit program
bios.use_multishell - enables Multishell on Advanced Computers, Turtles, Pocket Computers and Command Computers.
shell.allow_disk_startup - if a Disk Drive with a Disk inside that has a 'startup' script is attached to a computer, this setting allows to automatically run that script when the computer starts.
shell.allow_startup - if there is a 'startup' script in a computer's root, this setting allow to automatically run that script when the computer runs.

View File

@ -15,7 +15,10 @@ end
-- Create .lua files by default
if not fs.exists( sPath ) and not string.find( sPath, "%." ) then
sPath = sPath .. ".lua"
local sExtension = settings.get("edit.default_extension", "" )
if sExtension ~= "" then
sPath = sPath .. "." .. sExtension
end
end
local x,y = 1,1