Commit Graph

46 Commits

Author SHA1 Message Date
christos
ac4e17d0c7 Better fix for rl_prep_terminal() from Gerry Swislow. 2004-02-27 14:52:18 +00:00
christos
c8d67a7da2 portability fixes. 2004-01-17 17:57:40 +00:00
lukem
a9beb0e443 Tokenization function enhancements:
* Make tok_init(), tok_end(), tok_reset(), tok_line() and tok_str()
  publically available in <histedit.h>
* Documented the public functions in editline(3)
* Renamed tok_line() -> tok_str()
* Added new tok_line() which takes a "const LineInfo *" instead of
  "const char *" (the former has "cursor" information), and optionally
  return the argv index ("int *cursorc") and offset within that index
  ("int *cursorv").  This means that completion routines can use the
  tokenization code to crack the line and easily find which word the
  cursor is at.  (mmm, context sensitive completion :)
* Fixed TEST/test.c when using "continuation" lines (unmatched quote
  or \ at EOL), and added some more DEBUG messages including highlighting
  where the cursor is (with a `_').
2003-12-05 13:37:48 +00:00
christos
1b8a2beb0c Fix uninitialized variable. 2003-11-03 03:22:55 +00:00
christos
8467a84273 From: Gerry Swislow gerry at certif dot com
1) File name completion should list the files in the current directory
if no text is entered.  The previous version wouldn't list anything if
the text to complete was empty.

2) When listing directories, the entries "." and ".." shouldn't be
shown.

3) The filename completion should be used if the user's
rl_attempted_completion_function doesn't return any matches.  The
previous version didn't do that.
2003-11-02 01:45:14 +00:00
christos
391b46bc7f initialize ptr. 2003-11-01 23:39:22 +00:00
christos
8b40dcaecf Make readline csh-like history work.
From Gerry Swislow <gerry at certif dot com>.
2003-10-27 22:26:35 +00:00
christos
52215a07e7 add rl_catch_signals 2003-10-19 06:28:35 +00:00
christos
5d79eff8f5 More libedit readline emulation functions from: Gerry Swislow
<gerry at certif dot com>
2003-10-16 22:26:32 +00:00
christos
378865a426 don't limit ^c to alpha c, and add VIS_NOSLASH so that vis(3) does not
produce \^c
2003-10-15 18:08:40 +00:00
christos
5eda4a7d47 PR/23107: Nathan Williams: ^D as the first char on the command line does
not DTRT in readline compatibility mode
2003-10-09 00:42:28 +00:00
christos
552716dcff Implement enough of readline's 4.0 async mode to make gdb happy. This is
not complete yet, but it seems to work...
This required to introduce an unbuffered mode to el_gets(), but that was
a minor change.
2003-09-26 17:44:51 +00:00
christos
7fb5c922f1 Match the stupid function pointer declarations with actual readline's 4.0.
This is gross.
2003-09-14 22:15:23 +00:00
christos
7bb332f70b make this compile. 2003-09-14 21:55:39 +00:00
christos
166e18a7fd - provide enough hooks to compile gdb-5.3
- fix el_get(e, EL_TERMINAL, (char **))
2003-09-14 21:48:54 +00:00
christos
9b8791db6c From michael@moria.de:
Fix realloc case where we could be running out of space if too many matches.
2003-06-19 16:04:57 +00:00
christos
839ca00b3c From michael@moria.de:
- use __attribute__((__unused__)) in arguments where appropriate.
- some int -> size_t and char * to const char * conversions.
2003-06-19 15:55:05 +00:00
wiz
0acfa3bb9e Consistently spell occurrence with two rs. 2003-03-29 22:48:37 +00:00
christos
1d6595e599 null is not 0 2003-03-10 01:14:54 +00:00
christos
bdc91aaf9a include alloca.h for systems that need it. 2003-03-10 00:56:38 +00:00
christos
98e93eb66e fix directory descriptor leak [from michael at moria dot de] 2003-01-21 17:41:38 +00:00
christos
05e3eaeb34 remove unused variables. 2002-10-27 21:43:35 +00:00
christos
a17c7fe4a6 vi mode and memory fixes from david laight. 2002-10-27 21:41:50 +00:00
christos
e6ee03013b don't crash in memory shortage conditions. 2002-10-27 20:24:28 +00:00
thorpej
4f7523a4cc _rl_qsort_string_compare(): Fix casts. This makes gcc 3.2 happy,
and also allows both LINTED comments to be removed.
2002-04-09 01:57:34 +00:00
christos
b2b9c150ac Add a couple linted comment and enable WARNS=3 2002-03-18 16:20:36 +00:00
christos
0e0ac6b723 - constify; passes all gcc and lint strict checks.
- add config.h [Jason Evans], to create a portable version of libedit that
  can be easily compiled on other OS's.
2002-03-18 16:00:50 +00:00
jdolecek
3b81461031 fix partial completion - we failed to refresh screen in that case 2001-01-10 08:10:45 +00:00
christos
304ebe4875 depoison the pure editline code from readline compatibility hacks. 2001-01-05 22:45:30 +00:00
jdolecek
74c6c9c204 Standard location of readline headers is /usr/include/readline/, so install
them there.
readline.h of libedit had to move to subdirectory 'readline', due to the way
BSD makefiles work; this is better than potentially fragile Makefile hacks
2001-01-05 21:15:49 +00:00
christos
ab7e5eaeb3 fix lint problems. 2001-01-04 15:55:53 +00:00
jdolecek
a85f9ca211 Add support for rl_completion_append_character and rl_special_prefixes.
This addresses lib/10513 by Giles Lean. Tested with PostgreSQL 7.0.2 psql.
2001-01-01 15:52:25 +00:00
jdolecek
939ac12578 history_tokenize(): fix one off-by-one bug
rl_complete_internal(): only replace the completed string with common part
	of possible matches if there is a possible completion
2001-01-01 11:03:16 +00:00
jdolecek
26ffe99b32 rl_display_match_list():
* pad entries shorter than 'max' by spaces correctly
	* fix off-by-one error which caused extra newline to be printed
	  if the list fit exactly to a screen
	* fix typo in _rl_qsort_string_compare, which caused the list to not
	  be sorted after all
2000-12-31 09:50:32 +00:00
jdolecek
4acffb6417 completion_matches(): fix a off-by-one bug, fix variable name typo
implement displaying of possible completions, add hook to display the list
	on second rl_complete() invocation in row (typically, double <TAB>)

This addresses the completion part of lib/11581 by Richard Earnshaw.
2000-12-23 22:02:20 +00:00
lukem
d30d584a91 convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
2000-09-04 22:06:28 +00:00
jdolecek
371967cec8 Fix _rl_compat_sub() to really honour 'globally' flag instead
of making the substitution always globally - affects
	_history_expand_command() and in turn history_expand()

All praise lint :)
2000-03-10 13:06:43 +00:00
jdolecek
833166a288 readline(): don't dereference NULL pointer if prompt is NULL
history_tokenize(): avoid stepping too far if backslash is last character
	on the passed string
update some comments

This makes gdb \ escaping work reliably and fixes lib/9511 by Assar Westerlund.
2000-03-10 12:55:15 +00:00
lukem
87c1844d34 don't try to free() something allocated with alloca() in rl_complete_internal().
(noticed while using completion in gdb and getting inundated with warnings from
the new free())
1999-07-03 11:55:51 +00:00
simonb
1528b77539 More trailing white space. 1999-07-02 15:14:07 +00:00
christos
c3f0ff041d Make this compile under linux 1999-06-12 18:58:05 +00:00
christos
a0be074d8b many problems; variables hidden by others, size_t <-> confusion 1998-12-12 19:54:16 +00:00
christos
96c915840c Adjust to the libedit api changes. 1998-05-20 01:03:06 +00:00
thorpej
142a4c50c4 el_gets() takes an int *, not a size_t *. 1997-11-12 21:56:05 +00:00
christos
bc7956dee1 Const de-poisoning :-( Unfortunately the default gnu readline does not
have full prototypes... With those changes, and a single line change in
gdb/top.c, gdb links with -ledit
1997-10-23 22:51:59 +00:00
christos
f7de801d6c PR/4301: Jaromir Dolecek. Add gnu-readline wrapper for editline. 1997-10-23 22:24:09 +00:00