diff options
| author | christos <christos@NetBSD.org> | 2008-04-05 15:53:28 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2008-04-05 15:53:28 +0000 |
| commit | 0cb4d42e166dcb592adf4426c078bbbdf8641c7f (patch) | |
| tree | 9d19b9dcc447c91fac080f6e51a331bca50ccd4a /lib/libedit | |
| parent | 3069a1f144dd2da179c42975bf71efcdb367709a (diff) | |
add EL_REFRESH for the benefit of readline
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/editline.3 | 6 | ||||
| -rw-r--r-- | lib/libedit/el.c | 10 | ||||
| -rw-r--r-- | lib/libedit/histedit.h | 7 | ||||
| -rw-r--r-- | lib/libedit/readline.c | 8 |
4 files changed, 19 insertions, 12 deletions
diff --git a/lib/libedit/editline.3 b/lib/libedit/editline.3 index a0f32b6a1b8..0a96a218c6b 100644 --- a/lib/libedit/editline.3 +++ b/lib/libedit/editline.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $ +.\" $NetBSD: editline.3,v 1.56 2008/04/05 15:53:28 christos Exp $ .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 12, 2007 +.Dd April 5, 2008 .Os .Dt EDITLINE 3 .Sh NAME @@ -220,6 +220,8 @@ are supported, along with the required argument list: Define prompt printing function as .Fa f , which is to return a string that contains the prompt. +.It Dv EL_REFRESH +Re-display the current line on the next terminal line. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" Define right side prompt printing function as .Fa f , diff --git a/lib/libedit/el.c b/lib/libedit/el.c index 7e51bcec4b9..998d177c962 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.44 2006/12/15 22:13:33 christos Exp $ */ +/* $NetBSD: el.c,v 1.45 2008/04/05 15:53:28 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.44 2006/12/15 22:13:33 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.45 2008/04/05 15:53:28 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -308,6 +308,12 @@ el_set(EditLine *el, int op, ...) break; } + case EL_REFRESH: + re_clear_display(el); + re_refresh(el); + term__flush(); + break; + default: rv = -1; break; diff --git a/lib/libedit/histedit.h b/lib/libedit/histedit.h index fddc679b1a6..5496cbfa762 100644 --- a/lib/libedit/histedit.h +++ b/lib/libedit/histedit.h @@ -1,4 +1,4 @@ -/* $NetBSD: histedit.h,v 1.32 2007/06/10 20:20:28 christos Exp $ */ +/* $NetBSD: histedit.h,v 1.33 2008/04/05 15:53:28 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -134,8 +134,9 @@ unsigned char _el_fn_complete(EditLine *, int); #define EL_UNBUFFERED 15 /* , int); */ #define EL_PREP_TERM 16 /* , int); */ #define EL_GETTC 17 /* , const char *, ..., NULL); */ -#define EL_GETFP 18 /* , int, FILE **) */ -#define EL_SETFP 19 /* , int, FILE *) */ +#define EL_GETFP 18 /* , int, FILE **); */ +#define EL_SETFP 19 /* , int, FILE *); */ +#define EL_REFRESH 20 /* , void); */ #define EL_BUILTIN_GETCFN (NULL) diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c index 56a2d907938..67d443a2936 100644 --- a/lib/libedit/readline.c +++ b/lib/libedit/readline.c @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.73 2008/04/04 21:18:34 christos Exp $ */ +/* $NetBSD: readline.c,v 1.74 2008/04/05 15:53:28 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.73 2008/04/04 21:18:34 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.74 2008/04/05 15:53:28 christos Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -1903,9 +1903,7 @@ rl_filename_completion_function (const char *text, int state) void rl_forced_update_display(void) { - re_clear_display(e); - re_refresh(e); - term__flush(); + el_set(e, EL_REFRESH); } int |
