commit bash-20160311 snapshot

This commit is contained in:
Chet Ramey
2016-03-30 10:54:52 -04:00
parent c5cc27c847
commit f1b255b12b
6 changed files with 53 additions and 3 deletions
+13
View File
@@ -10552,3 +10552,16 @@ examples/loadables/Makefile.in
install-supported target to create it first. Bug with parallel
install (`make -j 4 install') reported by Chris Staub
<cstaub67@gmail.com>
3/12
----
lib/readline/display.c:
- rl_clear_visible_line: clear all screen lines occupied by the current
visible readline line. Inspired by report from Lauri Ranta
<lauri.ranta@gmail.com>
lib/readline/readline.h
- rl_clear_visible_line: extern declaration
lib/readline/doc/rltech.texi
- rl_clear_visible_line: add documentation
+4
View File
@@ -4080,8 +4080,12 @@ bash_execute_unix_command (count, key)
ce = rl_get_termcap ("ce");
if (ce) /* clear current line */
{
#if 0
fprintf (rl_outstream, "\r");
tputs (ce, 1, putx);
#else
rl_clear_visible_line ();
#endif
fflush (rl_outstream);
}
else
+28
View File
@@ -2027,6 +2027,34 @@ rl_on_new_line ()
return 0;
}
/* Clear all screen lines occupied by the current readline line buffer
(visible line) */
int
rl_clear_visible_line ()
{
int curr_line;
/* Make sure we move to column 0 so we clear the entire line */
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_last_c_pos = 0;
/* Move to the last screen line of the current visible line */
_rl_move_vert (_rl_vis_botlin);
/* And erase screen lines going up to line 0 (first visible line) */
for (curr_line = _rl_last_v_pos; curr_line >= 0; curr_line--)
{
_rl_move_vert (curr_line);
_rl_clear_to_eol (0);
}
return 0;
}
/* Tell the update routines that we have moved onto a new line with the
prompt already displayed. Code originally from the version of readline
distributed with CLISP. rl_expand_prompt must have already been called
+4
View File
@@ -963,6 +963,10 @@ redisplay.
It should be used after setting @var{rl_already_prompted}.
@end deftypefun
@deftypefun int rl_clear_visible_line (void)
Clear the screen lines corresponding to the current line's contents.
@end deftypefun
@deftypefun int rl_reset_line_state (void)
Reset the display state to a clean state and redisplay the current line
starting on a new line.
+3 -3
View File
@@ -4,7 +4,7 @@ Copyright (C) 1988-2016 Free Software Foundation, Inc.
@set EDITION 7.0
@set VERSION 7.0
@set UPDATED 28 February 2016
@set UPDATED-MONTH February 2016
@set UPDATED 12 March 2016
@set UPDATED-MONTH March 2016
@set LASTCHANGE Sun Feb 28 15:31:16 EST 2016
@set LASTCHANGE Sat Mar 12 15:45:03 EST 2016
+1
View File
@@ -379,6 +379,7 @@ extern void rl_redisplay PARAMS((void));
extern int rl_on_new_line PARAMS((void));
extern int rl_on_new_line_with_prompt PARAMS((void));
extern int rl_forced_update_display PARAMS((void));
extern int rl_clear_visible_line PARAMS((void));
extern int rl_clear_message PARAMS((void));
extern int rl_reset_line_state PARAMS((void));
extern int rl_crlf PARAMS((void));