Mercurial > hg > octave-lyh
changeset 1441:b44fe7cf2a6b
[project @ 1995-09-19 21:06:07 by jwe]
author | jwe |
---|---|
date | Tue, 19 Sep 1995 21:08:09 +0000 |
parents | f18c5b5db882 |
children | 4f2e40ba7f77 |
files | readline/parens.c readline/readline.h src/input.cc |
diffstat | 3 files changed, 24 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/readline/parens.c +++ b/readline/parens.c @@ -28,6 +28,16 @@ #include "rlconf.h" +#if defined (HAVE_STRING_H) +# include <string.h> +#else /* !HAVE_STRING_H */ +# include <strings.h> +#endif /* !HAVE_STRING_H */ + +/* List of characters treated as string delimiters if doing paren + matching. By default this is "'\"". */ +char *rl_paren_string_delimiters = "'\""; + #if !defined (PAREN_MATCHING) rl_insert_close (count, invoking_key) @@ -131,10 +141,13 @@ for (i = from; i > -1; i--) { + char *match = 0; + if (delimiter && (string[i] == delimiter)) delimiter = 0; - else if ((string[i] == '\'') || (string[i] == '"')) - delimiter = rl_line_buffer[i]; + else if (rl_paren_string_delimiters + && (match = strchr (rl_paren_string_delimiters, string[i]))) + delimiter = *match; else if (!delimiter && (string[i] == closer)) level++; else if (!delimiter && (string[i] == opener))
--- a/readline/readline.h +++ b/readline/readline.h @@ -172,6 +172,10 @@ Nothing is added if this is '\0'. */ extern char rl_completion_append_character; +/* List of characters treated as string delimiters if doing paren + matching. By default this is "'\"". */ +extern char *rl_paren_string_delimiters; + /* List of characters that are word break characters, but should be left in TEXT when it is passed to the completion function. The shell uses this to help determine what kind of completing to do. */