Adjusting a few comments and line wrappings.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-05-03 13:56:51 +00:00
parent 46464105f2
commit a338798559
3 changed files with 31 additions and 48 deletions

View File

@ -1,6 +1,7 @@
2015-05-03 Benno Schulenberg <bensberg@justemail.net> 2015-05-03 Benno Schulenberg <bensberg@justemail.net>
* src/browser.c (browser_refresh): Display an ellipsis only when the * src/browser.c (browser_refresh): Display an ellipsis only when the
filename is longer than the available space, not when it still fits. filename is longer than the available space, not when it still fits.
* src/browser.c, src/nano.c: Adjust a few comments and line wrappings.
2015-04-28 Benno Schulenberg <bensberg@justemail.net> 2015-04-28 Benno Schulenberg <bensberg@justemail.net>
* src/color.c (color_update): Match the file regex of a syntax against * src/color.c (color_update): Match the file regex of a syntax against

View File

@ -543,14 +543,10 @@ void browser_refresh(void)
{ {
static int uimax_digits = -1; static int uimax_digits = -1;
size_t i; size_t i;
int col = 0; int line = 0, col = 0;
/* The maximum number of columns that the filenames will take /* The current line and column while the list is getting displayed. */
* up. */
int line = 0;
/* The maximum number of lines that the filenames will take
* up. */
char *foo; char *foo;
/* The file information that we'll display. */ /* The additional information that we'll display about a file. */
if (uimax_digits == -1) if (uimax_digits == -1)
uimax_digits = digits(UINT_MAX); uimax_digits = digits(UINT_MAX);
@ -585,15 +581,13 @@ void browser_refresh(void)
* "(dir)", or the file size, plus three columns for the * "(dir)", or the file size, plus three columns for the
* ellipsis. */ * ellipsis. */
/* Start highlighting the currently selected file or /* Start highlighting the currently selected file or directory. */
* directory. */
if (i == selected) if (i == selected)
wattron(edit, hilite_attribute); wattron(edit, hilite_attribute);
blank_line(edit, line, col, longest); blank_line(edit, line, col, longest);
/* If dots is TRUE, we will display something like /* If dots is TRUE, we will display something like "...ename". */
* "...ename". */
if (dots) if (dots)
mvwaddstr(edit, line, col, "..."); mvwaddstr(edit, line, col, "...");
mvwaddstr(edit, line, dots ? col + 3 : col, disp); mvwaddstr(edit, line, dots ? col + 3 : col, disp);
@ -613,14 +607,12 @@ void browser_refresh(void)
/* If the file is a symlink that points to a directory, /* If the file is a symlink that points to a directory,
* display it as a directory. */ * display it as a directory. */
else else
/* TRANSLATORS: Try to keep this at most 7 /* TRANSLATORS: Try to keep this at most 7 characters. */
* characters. */
foo = mallocstrcpy(NULL, _("(dir)")); foo = mallocstrcpy(NULL, _("(dir)"));
} else if (S_ISDIR(st.st_mode)) { } else if (S_ISDIR(st.st_mode)) {
/* If the file is a directory, display it as such. */ /* If the file is a directory, display it as such. */
if (strcmp(filetail, "..") == 0) { if (strcmp(filetail, "..") == 0) {
/* TRANSLATORS: Try to keep this at most 12 /* TRANSLATORS: Try to keep this at most 12 characters. */
* characters. */
foo = mallocstrcpy(NULL, _("(parent dir)")); foo = mallocstrcpy(NULL, _("(parent dir)"));
foomaxlen = 12; foomaxlen = 12;
} else } else
@ -660,8 +652,7 @@ void browser_refresh(void)
mvwaddstr(edit, line, col - foolen, foo); mvwaddstr(edit, line, col - foolen, foo);
/* Finish highlighting the currently selected file or /* Finish highlighting the currently selected file or directory. */
* directory. */
if (i == selected) if (i == selected)
wattroff(edit, hilite_attribute); wattroff(edit, hilite_attribute);

View File

@ -556,7 +556,8 @@ void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
/* Unlink a node from the rest of the openfilestruct, and delete it. */ /* Unlink a node from the rest of the openfilestruct, and delete it. */
void unlink_opennode(openfilestruct *fileptr) void unlink_opennode(openfilestruct *fileptr)
{ {
assert(fileptr != NULL && fileptr->prev != NULL && fileptr->next != NULL && fileptr != fileptr->prev && fileptr != fileptr->next); assert(fileptr != NULL && fileptr->prev != NULL && fileptr->next != NULL &&
fileptr != fileptr->prev && fileptr != fileptr->next);
fileptr->prev->next = fileptr->next; fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev; fileptr->next->prev = fileptr->prev;
@ -851,27 +852,23 @@ void usage(void)
print_opt(_("-C <dir>"), _("--backupdir=<dir>"), print_opt(_("-C <dir>"), _("--backupdir=<dir>"),
N_("Directory for saving unique backup files")); N_("Directory for saving unique backup files"));
#endif #endif
print_opt("-D", "--boldtext", print_opt("-D", "--boldtext", N_("Use bold instead of reverse video text"));
N_("Use bold instead of reverse video text"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-E", "--tabstospaces", print_opt("-E", "--tabstospaces", N_("Convert typed tabs to spaces"));
N_("Convert typed tabs to spaces"));
#endif #endif
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
print_opt("-F", "--multibuffer", print_opt("-F", "--multibuffer",
N_("Read a file into a new buffer by default")); N_("Read a file into a new buffer by default"));
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-G", "--locking", print_opt("-G", "--locking", N_("Use (vim-style) lock files"));
N_("Use (vim-style) lock files"));
#endif #endif
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
print_opt("-H", "--historylog", print_opt("-H", "--historylog",
N_("Log & read search/replace string history")); N_("Log & read search/replace string history"));
#endif #endif
#ifndef DISABLE_NANORC #ifndef DISABLE_NANORC
print_opt("-I", "--ignorercfiles", print_opt("-I", "--ignorercfiles", N_("Don't look at nanorc files"));
N_("Don't look at nanorc files"));
#endif #endif
print_opt("-K", "--rebindkeypad", print_opt("-K", "--rebindkeypad",
N_("Fix numeric keypad key confusion problem")); N_("Fix numeric keypad key confusion problem"));
@ -883,25 +880,21 @@ void usage(void)
#endif #endif
print_opt("-O", "--morespace", N_("Use one more line for editing")); print_opt("-O", "--morespace", N_("Use one more line for editing"));
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
print_opt("-P", "--poslog", print_opt("-P", "--poslog", N_("Log & read location of cursor position"));
N_("Log & read location of cursor position"));
#endif #endif
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
print_opt(_("-Q <str>"), _("--quotestr=<str>"), print_opt(_("-Q <str>"), _("--quotestr=<str>"), N_("Quoting string"));
N_("Quoting string"));
#endif #endif
print_opt("-R", "--restricted", N_("Restricted mode")); print_opt("-R", "--restricted", N_("Restricted mode"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-S", "--smooth", print_opt("-S", "--smooth", N_("Scroll by line instead of half-screen"));
N_("Scroll by line instead of half-screen"));
#endif #endif
print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"), print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"),
N_("Set width of a tab to #cols columns")); N_("Set width of a tab to #cols columns"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-U", "--quickblank", N_("Do quick statusbar blanking")); print_opt("-U", "--quickblank", N_("Do quick statusbar blanking"));
#endif #endif
print_opt("-V", "--version", print_opt("-V", "--version", N_("Print version information and exit"));
N_("Print version information and exit"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-W", "--wordbounds", print_opt("-W", "--wordbounds",
N_("Detect word boundaries more accurately")); N_("Detect word boundaries more accurately"));
@ -915,12 +908,10 @@ void usage(void)
N_("Fix Backspace/Delete confusion problem")); N_("Fix Backspace/Delete confusion problem"));
print_opt("-h", "--help", N_("Show this help text")); print_opt("-h", "--help", N_("Show this help text"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-i", "--autoindent", print_opt("-i", "--autoindent", N_("Automatically indent new lines"));
N_("Automatically indent new lines"));
print_opt("-k", "--cut", N_("Cut from cursor to end of line")); print_opt("-k", "--cut", N_("Cut from cursor to end of line"));
#endif #endif
print_opt("-l", "--nofollow", print_opt("-l", "--nofollow", N_("Don't follow symbolic links, overwrite"));
N_("Don't follow symbolic links, overwrite"));
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
print_opt("-m", "--mouse", N_("Enable the use of the mouse")); print_opt("-m", "--mouse", N_("Enable the use of the mouse"));
#endif #endif
@ -929,8 +920,7 @@ void usage(void)
print_opt(_("-o <dir>"), _("--operatingdir=<dir>"), print_opt(_("-o <dir>"), _("--operatingdir=<dir>"),
N_("Set operating directory")); N_("Set operating directory"));
#endif #endif
print_opt("-p", "--preserve", print_opt("-p", "--preserve", N_("Preserve XON (^Q) and XOFF (^S) keys"));
N_("Preserve XON (^Q) and XOFF (^S) keys"));
#ifndef DISABLE_NANORC #ifndef DISABLE_NANORC
print_opt("-q", "--quiet", print_opt("-q", "--quiet",
N_("Silently ignore startup issues like rc file errors")); N_("Silently ignore startup issues like rc file errors"));
@ -943,8 +933,7 @@ void usage(void)
print_opt(_("-s <prog>"), _("--speller=<prog>"), print_opt(_("-s <prog>"), _("--speller=<prog>"),
N_("Enable alternate speller")); N_("Enable alternate speller"));
#endif #endif
print_opt("-t", "--tempfile", print_opt("-t", "--tempfile", N_("Auto save on exit, don't prompt"));
N_("Auto save on exit, don't prompt"));
print_opt("-v", "--view", N_("View mode (read-only)")); print_opt("-v", "--view", N_("View mode (read-only)"));
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines")); print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines"));
@ -1168,9 +1157,12 @@ void do_cancel(void)
; ;
} }
static struct sigaction pager_oldaction, pager_newaction; /* Original and temporary handlers for SIGINT. */ static struct sigaction pager_oldaction, pager_newaction;
static bool pager_sig_failed = FALSE; /* Did sigaction() fail without changing the signal handlers? */ /* Original and temporary handlers for SIGINT. */
static bool pager_input_aborted = FALSE; /* Did someone invoke the pager and abort it via ^C? */ static bool pager_sig_failed = FALSE;
/* Did sigaction() fail without changing the signal handlers? */
static bool pager_input_aborted = FALSE;
/* Did someone invoke the pager and abort it via ^C? */
/* Things which need to be run regardless of whether /* Things which need to be run regardless of whether
* we finished the stdin pipe correctly or not. */ * we finished the stdin pipe correctly or not. */
@ -1238,8 +1230,7 @@ void stdin_pager(void)
/* Initialize the signal handlers. */ /* Initialize the signal handlers. */
void signal_init(void) void signal_init(void)
{ {
/* Trap SIGINT and SIGQUIT because we want them to do useful /* Trap SIGINT and SIGQUIT because we want them to do useful things. */
* things. */
memset(&act, 0, sizeof(struct sigaction)); memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN; act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL); sigaction(SIGINT, &act, NULL);
@ -1314,7 +1305,7 @@ RETSIGTYPE do_suspend(int signal)
kill(0, SIGSTOP); kill(0, SIGSTOP);
} }
/* the subnfunc version */ /* The version of above function that is bound to a key. */
void do_suspend_void(void) void do_suspend_void(void)
{ {
if (ISSET(SUSPEND)) if (ISSET(SUSPEND))