Commit Graph

58 Commits

Author SHA1 Message Date
christos 45542456a5 PR/30747: David N. Williams: libedit is missing remove_history()
Added, please test.
2005-07-14 15:00:58 +00:00
christos 19c38590ee PR/30500: Paul Shupak: Inconsistent definition of tilde_expand().
Provide a layer of indirection between the readline compatibility functions
and our internal implementation, so that we have the freedom to change the
function signature.
2005-06-11 18:18:59 +00:00
christos 3cfbfdb2ef Bug reported from Martin Dietze:
The place to change the completion_append_character is
    usually somewhere in the `rl_completion_entry_function'
    callback which is where one usually can distinguish between
    file- or dir-like entries to append a slash for dirs etc.

    This does no longer work since `fn_complete()' takes the
    `append_character' as argument before the callback is executed,
    so that changes to the variable `rl_completion_append_character'
    have in fact no effect for the current completion.

Fix by adding a function that returns the rl_completion_append_character,
when it gets passed in a filename in readline emulation.
2005-06-10 20:21:00 +00:00
agc 305f170238 Use the correct type for the stored callback function 2005-05-27 14:01:46 +00:00
agc 26abf58dee Sync the alternative readline interface with reality:
+ the rl_callback_handler_install takes a pointer to a void function
  which has one char * argument (it's called that way in the readline
  emulation source, otherwise there's no way to pass the line buffer
  to the function which processes the line when EOL is encountered)

+ provide a prototype for that function signature and use it

Makes the callback readline interface work now.
2005-05-27 11:35:07 +00:00
dsl 41a59814ed Separate out the filename completion functions from the readline() code.
Pass in loads of parameters instead of relying on shed-loads of global
variables to modify the behaviour.
The filename completion code can now be enabled by code that uses el_gets().
(eg /bin/sh)
2005-05-07 16:01:25 +00:00
christos b9b92f846c check for pwd != NULL, fix a missed getpwnam. 2005-04-19 03:29:18 +00:00
christos a76abbed58 PR/29958: Peter Bex: add rl_variable_bind and rl_attempted_completion_over 2005-04-12 22:01:40 +00:00
christos bf7832efc6 use getpwent_r 2005-04-02 06:28:10 +00:00
christos af62817ea3 Always update the position variables before the map function is called.
From Rob Rodgers, thanks!
2005-03-10 19:34:46 +00:00
christos f96c72ee24 set UNBUFFERED again after you do the line callback so that the new line
gets refreshed.
2005-03-09 23:55:35 +00:00
christos 0d0ad08914 cut out the middle-man and use el_insertstr() directly. 2004-09-08 18:15:57 +00:00
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