Bash-4.0 patchlevel 38
This commit is contained in:
parent
17345e5ad2
commit
89a92869e5
27 changed files with 490 additions and 164 deletions
|
|
@ -2208,7 +2208,7 @@ rl_old_menu_complete (count, invoking_key)
|
|||
|
||||
/* The first time through, we generate the list of matches and set things
|
||||
up to insert them. */
|
||||
if (rl_last_func != rl_menu_complete)
|
||||
if (rl_last_func != rl_old_menu_complete)
|
||||
{
|
||||
/* Clean up from previous call, if any. */
|
||||
FREE (orig_text);
|
||||
|
|
@ -2220,6 +2220,8 @@ rl_old_menu_complete (count, invoking_key)
|
|||
|
||||
rl_completion_invoking_key = invoking_key;
|
||||
|
||||
RL_SETSTATE(RL_STATE_COMPLETING);
|
||||
|
||||
/* Only the completion entry function can change these. */
|
||||
set_completion_defaults ('%');
|
||||
|
||||
|
|
@ -2259,9 +2261,12 @@ rl_old_menu_complete (count, invoking_key)
|
|||
FREE (orig_text);
|
||||
orig_text = (char *)0;
|
||||
completion_changed_buffer = 0;
|
||||
RL_UNSETSTATE(RL_STATE_COMPLETING);
|
||||
return (0);
|
||||
}
|
||||
|
||||
RL_UNSETSTATE(RL_STATE_COMPLETING);
|
||||
|
||||
for (match_list_size = 0; matches[match_list_size]; match_list_size++)
|
||||
;
|
||||
/* matches[0] is lcd if match_list_size > 1, but the circular buffer
|
||||
|
|
@ -2337,6 +2342,8 @@ rl_menu_complete (count, ignore)
|
|||
|
||||
full_completion = 0;
|
||||
|
||||
RL_SETSTATE(RL_STATE_COMPLETING);
|
||||
|
||||
/* Only the completion entry function can change these. */
|
||||
set_completion_defaults ('%');
|
||||
|
||||
|
|
@ -2378,9 +2385,12 @@ rl_menu_complete (count, ignore)
|
|||
FREE (orig_text);
|
||||
orig_text = (char *)0;
|
||||
completion_changed_buffer = 0;
|
||||
RL_UNSETSTATE(RL_STATE_COMPLETING);
|
||||
return (0);
|
||||
}
|
||||
|
||||
RL_UNSETSTATE(RL_STATE_COMPLETING);
|
||||
|
||||
for (match_list_size = 0; matches[match_list_size]; match_list_size++)
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -512,6 +512,7 @@ rl_redisplay ()
|
|||
/* Block keyboard interrupts because this function manipulates global
|
||||
data structures. */
|
||||
_rl_block_sigint ();
|
||||
RL_SETSTATE (RL_STATE_REDISPLAYING);
|
||||
|
||||
if (!rl_display_prompt)
|
||||
rl_display_prompt = "";
|
||||
|
|
@ -1188,9 +1189,11 @@ rl_redisplay ()
|
|||
if (t < out)
|
||||
line[t - 1] = '>';
|
||||
|
||||
if (!rl_display_fixed || forced_display || lmargin != last_lmargin)
|
||||
if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin)
|
||||
{
|
||||
forced_display = 0;
|
||||
o_cpos = _rl_last_c_pos;
|
||||
cpos_adjusted = 0;
|
||||
update_line (&visible_line[last_lmargin],
|
||||
&invisible_line[lmargin],
|
||||
0,
|
||||
|
|
@ -1198,6 +1201,13 @@ rl_redisplay ()
|
|||
_rl_screenwidth + (lmargin ? 0 : wrap_offset),
|
||||
0);
|
||||
|
||||
if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
|
||||
cpos_adjusted == 0 &&
|
||||
_rl_last_c_pos != o_cpos &&
|
||||
_rl_last_c_pos > wrap_offset &&
|
||||
o_cpos < prompt_last_invisible)
|
||||
_rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */
|
||||
|
||||
/* If the visible new line is shorter than the old, but the number
|
||||
of invisible characters is greater, and we are at the end of
|
||||
the new line, we need to clear to eol. */
|
||||
|
|
@ -1236,6 +1246,7 @@ rl_redisplay ()
|
|||
visible_wrap_offset = wrap_offset;
|
||||
}
|
||||
|
||||
RL_UNSETSTATE (RL_STATE_REDISPLAYING);
|
||||
_rl_release_sigint ();
|
||||
}
|
||||
|
||||
|
|
@ -1772,7 +1783,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
|||
space_to_eol will insert too many spaces. XXX - maybe we should
|
||||
adjust col_lendiff based on the difference between _rl_last_c_pos
|
||||
and _rl_screenwidth */
|
||||
if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth))
|
||||
if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
|
||||
#endif
|
||||
{
|
||||
if (_rl_term_autowrap && current_line < inv_botlin)
|
||||
|
|
@ -1892,6 +1903,10 @@ _rl_move_cursor_relative (new, data)
|
|||
|
||||
woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
|
||||
cpos = _rl_last_c_pos;
|
||||
|
||||
if (cpos == 0 && cpos == new)
|
||||
return;
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* If we have multibyte characters, NEW is indexed by the buffer point in
|
||||
a multibyte string, but _rl_last_c_pos is the display position. In
|
||||
|
|
@ -1905,9 +1920,9 @@ _rl_move_cursor_relative (new, data)
|
|||
prompt string, since they're both buffer indices and DPOS is a
|
||||
desired display position. */
|
||||
if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
|
||||
(prompt_physical_chars > _rl_screenwidth &&
|
||||
(prompt_physical_chars >= _rl_screenwidth &&
|
||||
_rl_last_v_pos == prompt_last_screen_line &&
|
||||
wrap_offset >= woff &&
|
||||
wrap_offset >= woff && dpos >= woff &&
|
||||
new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
|
||||
/* XXX last comparison might need to be >= */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -814,8 +814,9 @@ extern int rl_inhibit_completion;
|
|||
#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */
|
||||
#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
|
||||
#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
|
||||
#define RL_STATE_REDISPLAYING 0x800000 /* updating terminal display */
|
||||
|
||||
#define RL_STATE_DONE 0x800000 /* done; accepted line */
|
||||
#define RL_STATE_DONE 0x1000000 /* done; accepted line */
|
||||
|
||||
#define RL_SETSTATE(x) (rl_readline_state |= (x))
|
||||
#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ rl_resize_terminal ()
|
|||
_rl_get_screen_size (fileno (rl_instream), 1);
|
||||
if (CUSTOM_REDISPLAY_FUNC ())
|
||||
rl_forced_update_display ();
|
||||
else
|
||||
else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0)
|
||||
_rl_redisplay_after_sigwinch ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue