diff options
author | 2019-03-26 11:13:37 +1100 | |
---|---|---|
committer | 2019-03-26 11:13:37 +1100 | |
commit | 97b67170277437131adf6ed4d60139c172529e4f (patch) | |
tree | 7a5cbf608f191075f1612b1af15832c206a3fe2d /plugins/console/init.lua | |
parent | b380514764cf857469bae61c11143a19f79a74c5 (diff) |
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and
c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at
598cd5227223c3b04ca31f0dbc1981256d9ea3ff.
Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline. When things like this happen, it wastes
everyone's time. I really don't need this in a week when real work⢠is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
Diffstat (limited to 'plugins/console/init.lua')
-rw-r--r-- | plugins/console/init.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/console/init.lua b/plugins/console/init.lua index 3cb75f55528..52d54fdcc1a 100644 --- a/plugins/console/init.lua +++ b/plugins/console/init.lua @@ -18,6 +18,16 @@ function console.startplugin() local matches = {} local lastindex = 0 local consolebuf + _G.history = function (index) + local history = ln.historyget() + if index then + ln.preload(history[index]) + return + end + for num, line in ipairs(history) do + print(num, line) + end + end print(" _/ _/ _/_/ _/ _/ _/_/_/_/"); print(" _/_/ _/_/ _/ _/ _/_/ _/_/ _/ "); print(" _/ _/ _/ _/_/_/_/ _/ _/ _/ _/_/_/ "); @@ -28,7 +38,7 @@ function console.startplugin() -- linenoise isn't thread safe but that means history can handled here -- that also means that bad things will happen if anything outside lua tries to use it -- especially the completion callback - ln.historysetmaxlen(10) + ln.historysetmaxlen(50) local scr = [[ local ln = require('linenoise') ln.setcompletion(function(c, str, pos) |