1
0
Fork 0

store 30 history entries by default (settable via property

/sim/gui/prop-key-handler/history-max-size)
This commit is contained in:
mfranz 2008-12-09 00:20:29 +00:00
parent 59ff8c6129
commit e5656fedc9

View file

@ -293,14 +293,14 @@ var search = func(n, s) {
_setlistener("/sim/signals/nasal-dir-initialized", func {
foreach (var p; props.globals.getNode("/sim/gui/prop-key-handler/history", 1).getChildren("entry"))
append(history, p.getValue());
var max = props.globals.initNode("/sim/gui/prop-key-handler/history-max-size", 20).getValue();
var max = props.globals.initNode("/sim/gui/prop-key-handler/history-max-size", 30).getValue();
if (size(history) > max)
history = subvec(history, size(history) - max);
});
_setlistener("/sim/signals/exit", func {
var max = props.globals.initNode("/sim/gui/prop-key-handler/history-max-size", 20).getValue();
var max = props.globals.initNode("/sim/gui/prop-key-handler/history-max-size", 30).getValue();
if (size(history) > max)
history = subvec(history, size(history) - max);
forindex (var i; history) {