From 2866043c3d6019f5102b914560b2ffeacc936cdf Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 8 Jun 2008 11:14:57 +0000 Subject: [PATCH] - prop_key_handler: limitate history to history-max-size on loading - string/debug: cosmetics --- Nasal/debug.nas | 6 +++--- Nasal/prop_key_handler.nas | 3 +++ Nasal/string.nas | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Nasal/debug.nas b/Nasal/debug.nas index 191593071..58c647528 100644 --- a/Nasal/debug.nas +++ b/Nasal/debug.nas @@ -25,12 +25,12 @@ # # debug.exit() ... exits fgfs # -# debug.bt ... abbreviation for debug.backtrace +# debug.bt() ... abbreviation for debug.backtrace() # # debug.string() ... returns contents of variable as string # debug.attributes( [, ]) ... returns attribute string for a given property. -# ose is by default 0, and shows the -# node's refcounter if 1. +# ose is by default 1, and suppressed the +# node's refcounter if 0. # # debug.load_nasal( [, ])) ... load and run Nasal file (under namespace # if defined, or the basename diff --git a/Nasal/prop_key_handler.nas b/Nasal/prop_key_handler.nas index 5c03e3709..45795d518 100644 --- a/Nasal/prop_key_handler.nas +++ b/Nasal/prop_key_handler.nas @@ -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); }); diff --git a/Nasal/string.nas b/Nasal/string.nas index ffdefde57..2b2204dca 100644 --- a/Nasal/string.nas +++ b/Nasal/string.nas @@ -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));