changeset 10500:8f27f368aba2

fix generating names for TAB completion
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 08 Apr 2010 14:37:19 -0400
parents fabed15083a4
children cbf6eebb2a0b
files src/ChangeLog src/help.cc
diffstat 2 files changed, 7 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Apr 08 14:37:36 2010 +0200
+++ b/src/ChangeLog	Thu Apr 08 14:37:19 2010 -0400
@@ -1,3 +1,8 @@
+2010-04-08  Jaroslav Hajek  <highegg@gmail.com>
+
+	* help.cc (make_name_list): Don't insert global and top-level scope
+	variables. Always insert current scope.
+
 2010-04-08  Jaroslav Hajek  <highegg@gmail.com>
 
 	* data.cc (SINGLE_TYPE_CONCAT, DO_SINGLE_TYPE_CONCAT): Replace by
--- a/src/help.cc	Thu Apr 08 14:37:36 2010 +0200
+++ b/src/help.cc	Thu Apr 08 14:37:19 2010 -0400
@@ -547,17 +547,7 @@
   const string_vector bif = symbol_table::built_in_function_names ();
   const int bif_len = bif.length ();
 
-  // FIXME -- is this really necessary here?
-  const string_vector glb = symbol_table::global_variable_names ();
-  const int glb_len = glb.length ();
-
-  // FIXME -- is this really necessary here?
-  const string_vector top = symbol_table::top_level_variable_names ();
-  const int top_len = top.length ();
-
-  string_vector lcl;
-  if (! symbol_table::at_top_level ())
-    lcl = symbol_table::variable_names ();
+  const string_vector lcl = symbol_table::variable_names ();
   const int lcl_len = lcl.length ();
 
   const string_vector ffl = load_path::fcn_names ();
@@ -566,8 +556,7 @@
   const string_vector afl = autoloaded_functions ();
   const int afl_len = afl.length ();
 
-  const int total_len = key_len + bif_len + glb_len + top_len + lcl_len
-    + ffl_len + afl_len;
+  const int total_len = key_len + bif_len + lcl_len + ffl_len + afl_len;
 
   string_vector list (total_len);
 
@@ -581,12 +570,6 @@
   for (i = 0; i < bif_len; i++)
     list[j++] = bif[i];
 
-  for (i = 0; i < glb_len; i++)
-    list[j++] = glb[i];
-
-  for (i = 0; i < top_len; i++)
-    list[j++] = top[i];
-
   for (i = 0; i < lcl_len; i++)
     list[j++] = lcl[i];