add EL_REFRESH for the benefit of readline

This commit is contained in:
christos 2008-04-05 15:53:28 +00:00
parent 3069a1f144
commit 0cb4d42e16
4 changed files with 19 additions and 12 deletions

View File

@ -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 ,

View File

@ -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;

View File

@ -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)

View File

@ -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