1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Merge pull request #232 from SquidDev-CC/feature/remove-duplicate-history

Do not insert empty or duplicate entries into shell history
This commit is contained in:
Daniel Ratcliffe 2017-05-15 14:00:15 +01:00 committed by GitHub
commit 7f365c5102
2 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,9 @@ while bRunning do
end
return nil
end )
table.insert( tCommandHistory, s )
if s:match("%S") and tCommandHistory[#tCommandHistory] ~= s then
table.insert( tCommandHistory, s )
end
local nForcePrint = 0
local func, e = load( s, "lua", "t", tEnv )

View File

@ -363,7 +363,9 @@ else
else
sLine = read( nil, tCommandHistory )
end
table.insert( tCommandHistory, sLine )
if sLine:match("%S") and tCommandHistory[#tCommandHistory] ~= sLine then
table.insert( tCommandHistory, sLine )
end
shell.run( sLine )
end
end