Mercurial > hg > octave-terminal
changeset 2235:896966940135
[project @ 1996-05-17 18:09:01 by jwe]
author | jwe |
---|---|
date | Fri, 17 May 1996 18:09:01 +0000 |
parents | a174011c96f2 |
children | eda6da293342 |
files | src/input.cc |
diffstat | 1 files changed, 19 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/input.cc +++ b/src/input.cc @@ -635,6 +635,8 @@ return rl_instream; } +// XXX FIXME XXX -- this should return a string_vector. + static const char ** generate_struct_completions (const char *text, char *& prefix, char *& hint) @@ -711,6 +713,7 @@ } // XXX FIXME XXX -- make this generate file names when appropriate. +// XXX FIXME XXX -- this should return a string_vector. static const char ** generate_possible_completions (const char *text, char *& prefix, @@ -787,6 +790,10 @@ return retval; } +// XXX FIXME XXX -- this has to return a pointer to char, but it +// should be converted to use a generating function that returns a +// string_vector. + static char * command_generator (const char *text, int state) { @@ -1223,13 +1230,16 @@ if (cmd) { - if (k > n) + if (*cmd) { - n *= 2; - list.resize (n); + if (k == n) + { + n *= 2; + list.resize (n); + } + + list[k++] = cmd; } - - list[k++] = cmd; } else { @@ -1242,6 +1252,10 @@ retval = list; else { + // We don't use string_vector::list_in_columns here + // because it will be easier for Emacs if the names + // appear in a single column. + int len = list.length (); for (int i = 0; i < len; i++)