in help_init(), if we have at least two entries' worth of blank space,

use it to display more of "^Space" and "M-Space"


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3414 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-04-23 01:10:55 +00:00
parent 97415dfdc7
commit 4fd74e0db4
2 changed files with 25 additions and 2 deletions

View File

@ -102,6 +102,10 @@ CVS code -
- Call get_shortcut() after getting input, so that we only have
to check for a main shortcut key instead of both it and all of
its equivalents. (DLR)
help_init()
- If we have at least two entries' worth of blank space, use it
to display more of "^Space" and "M-Space". (DLR, suggested by
Benno Schulenberg)
- nano.c:
renumber()
- Remove invalid assert. (DLR, found by Filipe Moreira)

View File

@ -414,9 +414,22 @@ void help_init(void)
/* Yucky sentinel values that we can't handle a better
* way. */
if (s->ctrlval == NANO_CONTROL_SPACE) {
char *space_ptr = display_string(_("Space"), 0, 6,
char *space_ptr = display_string(_("Space"), 0, 13,
FALSE);
if (s->funcval == NANO_NO_KEY && (s->metaval ==
NANO_NO_KEY || s->miscval == NANO_NO_KEY)) {
/* If we're here, we have at least two entries worth
* of blank space. If this entry takes up more than
* one entry's worth of space, use two to display
* it. */
if (strlen(space_ptr) + 1 > 7)
entries++;
} else
/* Otherwise, truncate it so that it takes up only
* one entry's worth of space. */
space_ptr[7] = '\0';
ptr += sprintf(ptr, "^%s", space_ptr);
free(space_ptr);
@ -452,9 +465,15 @@ void help_init(void)
/* Yucky sentinel values that we can't handle a better
* way. */
if (s->metaval == NANO_ALT_SPACE && entries == 1) {
char *space_ptr = display_string(_("Space"), 0, 5,
char *space_ptr = display_string(_("Space"), 0, 13,
FALSE);
/* If we're here, we have at least two entries worth of
* blank space. If this entry takes up more than one
* entry's worth of space, use two to display it. */
if (strlen(space_ptr) + 2 > 7)
entries++;
ptr += sprintf(ptr, "M-%s", space_ptr);
free(space_ptr);