"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "complete.c" between
readline-7.0-rc1.tar.gz and readline-7.0-rc2.tar.gz

About: GNU Readline library - get a line from a user with editing. Release candidate.

complete.c  (readline-7.0-rc1):complete.c  (readline-7.0-rc2)
skipping to change at line 217 skipping to change at line 217
int rl_visible_stats = 0; int rl_visible_stats = 0;
#endif /* VISIBLE_STATS */ #endif /* VISIBLE_STATS */
#if defined (COLOR_SUPPORT) #if defined (COLOR_SUPPORT)
/* Non-zero means to use colors to indicate file type when listing possible /* Non-zero means to use colors to indicate file type when listing possible
completions. The colors used are taken from $LS_COLORS, if set. */ completions. The colors used are taken from $LS_COLORS, if set. */
int _rl_colored_stats = 0; int _rl_colored_stats = 0;
/* Non-zero means to use a color (currently magenta) to indicate the common /* Non-zero means to use a color (currently magenta) to indicate the common
prefix of a set of possible word completions. */ prefix of a set of possible word completions. */
int _rl_colored_completion_prefix = 1; int _rl_colored_completion_prefix = 0;
#endif #endif
/* If non-zero, when completing in the middle of a word, don't insert /* If non-zero, when completing in the middle of a word, don't insert
characters from the match that match characters following point in characters from the match that match characters following point in
the word. This means, for instance, completing when the cursor is the word. This means, for instance, completing when the cursor is
after the `e' in `Makefile' won't result in `Makefilefile'. */ after the `e' in `Makefile' won't result in `Makefilefile'. */
int _rl_skip_completed_text = 0; int _rl_skip_completed_text = 0;
/* If non-zero, menu completion displays the common prefix first in the /* If non-zero, menu completion displays the common prefix first in the
cycle of possible completions instead of the last. */ cycle of possible completions instead of the last. */
skipping to change at line 810 skipping to change at line 810
#define ELLIPSIS_LEN 3 #define ELLIPSIS_LEN 3
static int static int
fnprint (to_print, prefix_bytes, real_pathname) fnprint (to_print, prefix_bytes, real_pathname)
const char *to_print; const char *to_print;
int prefix_bytes; int prefix_bytes;
const char *real_pathname; const char *real_pathname;
{ {
int printed_len, w; int printed_len, w;
const char *s; const char *s;
int common_prefix_len; int common_prefix_len, print_len;
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
mbstate_t ps; mbstate_t ps;
const char *end; const char *end;
size_t tlen; size_t tlen;
int width; int width;
wchar_t wc; wchar_t wc;
end = to_print + strlen (to_print) + 1; print_len = strlen (to_print);
end = to_print + print_len + 1;
memset (&ps, 0, sizeof (mbstate_t)); memset (&ps, 0, sizeof (mbstate_t));
#endif #endif
printed_len = common_prefix_len = 0; printed_len = common_prefix_len = 0;
/* Don't print only the ellipsis if the common prefix is one of the /* Don't print only the ellipsis if the common prefix is one of the
possible completions. Only cut off prefix_bytes if we're going to be possible completions. Only cut off prefix_bytes if we're going to be
printing the ellipsis, which takes precedence over coloring the printing the ellipsis, which takes precedence over coloring the
completion prefix (see print_filename() below). */ completion prefix (see print_filename() below). */
if (_rl_completion_prefix_display_length > 0 && to_print[prefix_bytes] == '\0' ) if (_rl_completion_prefix_display_length > 0 && prefix_bytes >= print_len)
prefix_bytes = 0; prefix_bytes = 0;
#if defined (COLOR_SUPPORT) #if defined (COLOR_SUPPORT)
if (_rl_colored_stats && (prefix_bytes == 0 || _rl_colored_completion_prefix < = 0)) if (_rl_colored_stats && (prefix_bytes == 0 || _rl_colored_completion_prefix < = 0))
colored_stat_start (real_pathname); colored_stat_start (real_pathname);
#endif #endif
if (prefix_bytes && _rl_completion_prefix_display_length > 0) if (prefix_bytes && _rl_completion_prefix_display_length > 0)
{ {
char ellipsis; char ellipsis;
skipping to change at line 1574 skipping to change at line 1575
int count, limit, printed_len, lines, cols; int count, limit, printed_len, lines, cols;
int i, j, k, l, common_length, sind; int i, j, k, l, common_length, sind;
char *temp, *t; char *temp, *t;
/* Find the length of the prefix common to all items: length as displayed /* Find the length of the prefix common to all items: length as displayed
characters (common_length) and as a byte index into the matches (sind) */ characters (common_length) and as a byte index into the matches (sind) */
common_length = sind = 0; common_length = sind = 0;
if (_rl_completion_prefix_display_length > 0) if (_rl_completion_prefix_display_length > 0)
{ {
t = printable_part (matches[0]); t = printable_part (matches[0]);
temp = strrchr (t, '/'); /* check again in case of /usr/src/ */ /* check again in case of /usr/src/ */
temp = rl_filename_completion_desired ? strrchr (t, '/') : 0;
common_length = temp ? fnwidth (temp) : fnwidth (t); common_length = temp ? fnwidth (temp) : fnwidth (t);
sind = temp ? strlen (temp) : strlen (t); sind = temp ? strlen (temp) : strlen (t);
if (common_length > max || sind > max)
common_length = sind = 0;
if (common_length > _rl_completion_prefix_display_length && common_length > ELLIPSIS_LEN) if (common_length > _rl_completion_prefix_display_length && common_length > ELLIPSIS_LEN)
max -= common_length - ELLIPSIS_LEN; max -= common_length - ELLIPSIS_LEN;
else else
common_length = sind = 0; common_length = sind = 0;
} }
#if defined (COLOR_SUPPORT) #if defined (COLOR_SUPPORT)
else if (_rl_colored_completion_prefix > 0) else if (_rl_colored_completion_prefix > 0)
{ {
t = printable_part (matches[0]); t = printable_part (matches[0]);
temp = strrchr (t, '/'); temp = rl_filename_completion_desired ? strrchr (t, '/') : 0;
common_length = temp ? fnwidth (temp) : fnwidth (t); common_length = temp ? fnwidth (temp) : fnwidth (t);
sind = temp ? RL_STRLEN (temp+1) : RL_STRLEN (t); /* want p ortion after final slash */ sind = temp ? RL_STRLEN (temp+1) : RL_STRLEN (t); /* want p ortion after final slash */
if (common_length > max || sind > max)
common_length = sind = 0;
} }
#endif #endif
/* How many items of MAX length can we fit in the screen window? */ /* How many items of MAX length can we fit in the screen window? */
cols = complete_get_screenwidth (); cols = complete_get_screenwidth ();
max += 2; max += 2;
limit = cols / max; limit = cols / max;
if (limit != 1 && (limit * max == cols)) if (limit != 1 && (limit * max == cols))
limit--; limit--;
skipping to change at line 1638 skipping to change at line 1644
for (j = 0, l = i; j < limit; j++) for (j = 0, l = i; j < limit; j++)
{ {
if (l > len || matches[l] == 0) if (l > len || matches[l] == 0)
break; break;
else else
{ {
temp = printable_part (matches[l]); temp = printable_part (matches[l]);
printed_len = print_filename (temp, matches[l], sind); printed_len = print_filename (temp, matches[l], sind);
if (j + 1 < limit) if (j + 1 < limit)
for (k = 0; k < max - printed_len; k++) {
putc (' ', rl_outstream); if (max <= printed_len)
putc (' ', rl_outstream);
else
for (k = 0; k < max - printed_len; k++)
putc (' ', rl_outstream);
}
} }
l += count; l += count;
} }
rl_crlf (); rl_crlf ();
#if defined (SIGWINCH) #if defined (SIGWINCH)
if (RL_SIG_RECEIVED () && RL_SIGWINCH_RECEIVED() == 0) if (RL_SIG_RECEIVED () && RL_SIGWINCH_RECEIVED() == 0)
#else #else
if (RL_SIG_RECEIVED ()) if (RL_SIG_RECEIVED ())
#endif #endif
return; return;
skipping to change at line 1686 skipping to change at line 1697
{ {
rl_crlf (); rl_crlf ();
lines++; lines++;
if (_rl_page_completions && lines >= _rl_screenheight - 1) if (_rl_page_completions && lines >= _rl_screenheight - 1)
{ {
lines = _rl_internal_pager (lines); lines = _rl_internal_pager (lines);
if (lines < 0) if (lines < 0)
return; return;
} }
} }
else if (max <= printed_len)
putc (' ', rl_outstream);
else else
for (k = 0; k < max - printed_len; k++) for (k = 0; k < max - printed_len; k++)
putc (' ', rl_outstream); putc (' ', rl_outstream);
} }
} }
rl_crlf (); rl_crlf ();
} }
} }
/* Display MATCHES, a list of matching filenames in argv format. This /* Display MATCHES, a list of matching filenames in argv format. This
 End of changes. 10 change blocks. 
8 lines changed or deleted 21 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS