1
0
Fork 0

- prop_key_handler: limitate history to history-max-size on loading

- string/debug: cosmetics
This commit is contained in:
mfranz 2008-06-08 11:14:57 +00:00
parent 166f5c8b96
commit 2866043c3d
3 changed files with 7 additions and 4 deletions

View file

@ -25,12 +25,12 @@
# #
# debug.exit() ... exits fgfs # debug.exit() ... exits fgfs
# #
# debug.bt ... abbreviation for debug.backtrace # debug.bt() ... abbreviation for debug.backtrace()
# #
# debug.string(<variable>) ... returns contents of variable as string # debug.string(<variable>) ... returns contents of variable as string
# debug.attributes(<property> [, <verb>]) ... returns attribute string for a given property. # debug.attributes(<property> [, <verb>]) ... returns attribute string for a given property.
# <verb>ose is by default 0, and shows the # <verb>ose is by default 1, and suppressed the
# node's refcounter if 1. # node's refcounter if 0.
# #
# debug.load_nasal(<file> [, <module>])) ... load and run Nasal file (under namespace # debug.load_nasal(<file> [, <module>])) ... load and run Nasal file (under namespace
# <module> if defined, or the basename # <module> if defined, or the basename

View file

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

View file

@ -60,7 +60,7 @@ var uc = func(str) {
## ##
# case insensitive string compare and match functions # case insensitive string compare and match functions
# (not very effective -- converting the array to be sorted # (not very efficient -- converting the array to be sorted
# first is faster) # first is faster)
# #
var icmp = func(a, b) cmp(lc(a), lc(b)); var icmp = func(a, b) cmp(lc(a), lc(b));