- prop_key_handler: limitate history to history-max-size on loading
- string/debug: cosmetics
This commit is contained in:
parent
166f5c8b96
commit
2866043c3d
3 changed files with 7 additions and 4 deletions
|
@ -25,12 +25,12 @@
|
|||
#
|
||||
# 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.attributes(<property> [, <verb>]) ... returns attribute string for a given property.
|
||||
# <verb>ose is by default 0, and shows the
|
||||
# node's refcounter if 1.
|
||||
# <verb>ose is by default 1, and suppressed the
|
||||
# node's refcounter if 0.
|
||||
#
|
||||
# debug.load_nasal(<file> [, <module>])) ... load and run Nasal file (under namespace
|
||||
# <module> if defined, or the basename
|
||||
|
|
|
@ -291,6 +291,9 @@ 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.initNode("/sim/gui/prop-key-handler/history-max-size", 20).getValue();
|
||||
if (size(history) > max)
|
||||
history = subvec(history, size(history) - max);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ var uc = func(str) {
|
|||
|
||||
##
|
||||
# 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)
|
||||
#
|
||||
var icmp = func(a, b) cmp(lc(a), lc(b));
|
||||
|
|
Loading…
Reference in a new issue