miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2892 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-07-18 18:43:39 +00:00
parent 0dd50d6f62
commit 7dc531a801
2 changed files with 10 additions and 8 deletions

View File

@ -83,6 +83,9 @@ CVS code -
- Assert that filename isn't NULL, and don't do anything special - Assert that filename isn't NULL, and don't do anything special
if it's blank, as the the former case shouldn't occur, and the if it's blank, as the the former case shouldn't occur, and the
latter case is now handled elsewhere. (DLR) latter case is now handled elsewhere. (DLR)
input_tab()
- Make columns an int instead of a size_t, since it's limited by
COLS. (DLR)
- global.c: - global.c:
shortcut_init() shortcut_init()
- Simplify wording of nano_gotoline_msg. (Jordi and Ken Tyler) - Simplify wording of nano_gotoline_msg. (Jordi and Ken Tyler)

View File

@ -2119,8 +2119,8 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
while (TRUE) { while (TRUE) {
for (match = 1; match < num_matches; match++) { for (match = 1; match < num_matches; match++) {
/* Get the number of single-byte characters that match1 /* Get the number of single-byte characters that all the
* and match2 have in common. */ * matches have in common. */
match1_mb_len = parse_mbchar(matches[0] + common_len, match1_mb_len = parse_mbchar(matches[0] + common_len,
match1_mb, NULL, NULL); match1_mb, NULL, NULL);
match2_mb_len = parse_mbchar(matches[match] + match2_mb_len = parse_mbchar(matches[match] +
@ -2161,7 +2161,7 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
beep(); beep();
/* If there is more of a match to display on the statusbar, show /* If there is more of a match to display on the statusbar, show
* it. We reset lastwastab to FALSE: it requires hitting Tab * it. We reset lastwastab to FALSE: it requires pressing Tab
* twice in succession with no statusbar changes to see a match * twice in succession with no statusbar changes to see a match
* list. */ * list. */
if (common_len != *place) { if (common_len != *place) {
@ -2176,8 +2176,7 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
} else if (*lastwastab == FALSE || num_matches < 2) } else if (*lastwastab == FALSE || num_matches < 2)
*lastwastab = TRUE; *lastwastab = TRUE;
else { else {
int longest_name = 0, editline = 0; int longest_name = 0, columns, editline = 0;
size_t columns;
/* Now we show a list of the available choices. */ /* Now we show a list of the available choices. */
assert(num_matches > 1); assert(num_matches > 1);
@ -2199,9 +2198,9 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
assert(longest_name <= COLS - 1); assert(longest_name <= COLS - 1);
/* Each column will be longest_name + 2 characters wide, /* Each column will be (longest_name + 2) columns wide, i.e,
* i.e, two spaces between columns, except that there will * two spaces between columns, except that there will be
* be only one space after the last column. */ * only one space after the last column. */
columns = (COLS + 1) / (longest_name + 2); columns = (COLS + 1) / (longest_name + 2);
/* Blank the edit window, and print the matches out /* Blank the edit window, and print the matches out