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:
parent
f5edb32be9
commit
50a4a961e5
@ -516,8 +516,8 @@ while bRunning do
|
|||||||
else
|
else
|
||||||
-- Indent line
|
-- Indent line
|
||||||
local sLine = tLines[y]
|
local sLine = tLines[y]
|
||||||
tLines[y] = string.sub(sLine,1,x-1) .. " " .. string.sub(sLine,x)
|
tLines[y] = string.sub(sLine,1,x-1) .. " " .. string.sub(sLine,x)
|
||||||
setCursor( x + 2, y )
|
setCursor( x + 4, y )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -634,8 +634,13 @@ while bRunning do
|
|||||||
if x > 1 then
|
if x > 1 then
|
||||||
-- Remove character
|
-- Remove character
|
||||||
local sLine = tLines[y]
|
local sLine = tLines[y]
|
||||||
tLines[y] = string.sub(sLine,1,x-2) .. string.sub(sLine,x)
|
if x > 4 and string.sub(sLine,x-4,x-1) == " " then
|
||||||
setCursor( x - 1, y )
|
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
|
elseif y > 1 then
|
||||||
-- Remove newline
|
-- Remove newline
|
||||||
local sPrevLen = string.len( tLines[y-1] )
|
local sPrevLen = string.len( tLines[y-1] )
|
||||||
|
Loading…
Reference in New Issue
Block a user