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:
commit
7f365c5102
@ -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 )
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user