1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-12 02:10:30 +00:00

Pressing tab in "edit" now inserts 4 spaces instead of 2, backspace now deletes them

This commit is contained in:
Daniel Ratcliffe 2017-05-17 19:48:22 +01:00
parent f5edb32be9
commit 50a4a961e5

View File

@ -517,7 +517,7 @@ while bRunning do
-- Indent line
local sLine = tLines[y]
tLines[y] = string.sub(sLine,1,x-1) .. " " .. string.sub(sLine,x)
setCursor( x + 2, y )
setCursor( x + 4, y )
end
end
@ -634,8 +634,13 @@ while bRunning do
if x > 1 then
-- Remove character
local sLine = tLines[y]
if x > 4 and string.sub(sLine,x-4,x-1) == " " then
tLines[y] = string.sub(sLine,1,x-5) .. string.sub(sLine,x)
setCursor( x - 4, y )
else
tLines[y] = string.sub(sLine,1,x-2) .. string.sub(sLine,x)
setCursor( x - 1, y )
end
elseif y > 1 then
-- Remove newline
local sPrevLen = string.len( tLines[y-1] )