{
static int uimax_digits = -1;
size_t i;
- int col = 0;
- /* The maximum number of columns that the filenames will take
- * up. */
- int line = 0;
- /* The maximum number of lines that the filenames will take
- * up. */
+ int line = 0, col = 0;
+ /* The current line and column while the list is getting displayed. */
char *foo;
- /* The file information that we'll display. */
+ /* The additional information that we'll display about a file. */
if (uimax_digits == -1)
uimax_digits = digits(UINT_MAX);
* "(dir)", or the file size, plus three columns for the
* ellipsis. */
- /* Start highlighting the currently selected file or
- * directory. */
+ /* Start highlighting the currently selected file or directory. */
if (i == selected)
wattron(edit, hilite_attribute);
blank_line(edit, line, col, longest);
- /* If dots is TRUE, we will display something like
- * "...ename". */
+ /* If dots is TRUE, we will display something like "...ename". */
if (dots)
mvwaddstr(edit, line, col, "...");
mvwaddstr(edit, line, dots ? col + 3 : col, disp);
/* If the file is a symlink that points to a directory,
* display it as a directory. */
else
- /* TRANSLATORS: Try to keep this at most 7
- * characters. */
+ /* TRANSLATORS: Try to keep this at most 7 characters. */
foo = mallocstrcpy(NULL, _("(dir)"));
} else if (S_ISDIR(st.st_mode)) {
/* If the file is a directory, display it as such. */
if (strcmp(filetail, "..") == 0) {
- /* TRANSLATORS: Try to keep this at most 12
- * characters. */
+ /* TRANSLATORS: Try to keep this at most 12 characters. */
foo = mallocstrcpy(NULL, _("(parent dir)"));
foomaxlen = 12;
} else
mvwaddstr(edit, line, col - foolen, foo);
- /* Finish highlighting the currently selected file or
- * directory. */
+ /* Finish highlighting the currently selected file or directory. */
if (i == selected)
wattroff(edit, hilite_attribute);
/* Unlink a node from the rest of the openfilestruct, and delete it. */
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->next->prev = fileptr->prev;
print_opt(_("-C <dir>"), _("--backupdir=<dir>"),
N_("Directory for saving unique backup files"));
#endif
- print_opt("-D", "--boldtext",
- N_("Use bold instead of reverse video text"));
+ print_opt("-D", "--boldtext", N_("Use bold instead of reverse video text"));
#ifndef NANO_TINY
- print_opt("-E", "--tabstospaces",
- N_("Convert typed tabs to spaces"));
+ print_opt("-E", "--tabstospaces", N_("Convert typed tabs to spaces"));
#endif
#ifndef DISABLE_MULTIBUFFER
print_opt("-F", "--multibuffer",
N_("Read a file into a new buffer by default"));
#endif
#ifndef NANO_TINY
- print_opt("-G", "--locking",
- N_("Use (vim-style) lock files"));
+ print_opt("-G", "--locking", N_("Use (vim-style) lock files"));
#endif
#ifndef DISABLE_HISTORIES
print_opt("-H", "--historylog",
N_("Log & read search/replace string history"));
#endif
#ifndef DISABLE_NANORC
- print_opt("-I", "--ignorercfiles",
- N_("Don't look at nanorc files"));
+ print_opt("-I", "--ignorercfiles", N_("Don't look at nanorc files"));
#endif
print_opt("-K", "--rebindkeypad",
N_("Fix numeric keypad key confusion problem"));
#endif
print_opt("-O", "--morespace", N_("Use one more line for editing"));
#ifndef DISABLE_HISTORIES
- print_opt("-P", "--poslog",
- N_("Log & read location of cursor position"));
+ print_opt("-P", "--poslog", N_("Log & read location of cursor position"));
#endif
#ifndef DISABLE_JUSTIFY
- print_opt(_("-Q <str>"), _("--quotestr=<str>"),
- N_("Quoting string"));
+ print_opt(_("-Q <str>"), _("--quotestr=<str>"), N_("Quoting string"));
#endif
print_opt("-R", "--restricted", N_("Restricted mode"));
#ifndef NANO_TINY
- print_opt("-S", "--smooth",
- N_("Scroll by line instead of half-screen"));
+ print_opt("-S", "--smooth", N_("Scroll by line instead of half-screen"));
#endif
print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"),
N_("Set width of a tab to #cols columns"));
#ifndef NANO_TINY
print_opt("-U", "--quickblank", N_("Do quick statusbar blanking"));
#endif
- print_opt("-V", "--version",
- N_("Print version information and exit"));
+ print_opt("-V", "--version", N_("Print version information and exit"));
#ifndef NANO_TINY
print_opt("-W", "--wordbounds",
N_("Detect word boundaries more accurately"));
N_("Fix Backspace/Delete confusion problem"));
print_opt("-h", "--help", N_("Show this help text"));
#ifndef NANO_TINY
- print_opt("-i", "--autoindent",
- N_("Automatically indent new lines"));
+ print_opt("-i", "--autoindent", N_("Automatically indent new lines"));
print_opt("-k", "--cut", N_("Cut from cursor to end of line"));
#endif
- print_opt("-l", "--nofollow",
- N_("Don't follow symbolic links, overwrite"));
+ print_opt("-l", "--nofollow", N_("Don't follow symbolic links, overwrite"));
#ifndef DISABLE_MOUSE
print_opt("-m", "--mouse", N_("Enable the use of the mouse"));
#endif
print_opt(_("-o <dir>"), _("--operatingdir=<dir>"),
N_("Set operating directory"));
#endif
- print_opt("-p", "--preserve",
- N_("Preserve XON (^Q) and XOFF (^S) keys"));
+ print_opt("-p", "--preserve", N_("Preserve XON (^Q) and XOFF (^S) keys"));
#ifndef DISABLE_NANORC
print_opt("-q", "--quiet",
N_("Silently ignore startup issues like rc file errors"));
print_opt(_("-s <prog>"), _("--speller=<prog>"),
N_("Enable alternate speller"));
#endif
- print_opt("-t", "--tempfile",
- N_("Auto save on exit, don't prompt"));
+ print_opt("-t", "--tempfile", N_("Auto save on exit, don't prompt"));
print_opt("-v", "--view", N_("View mode (read-only)"));
#ifndef DISABLE_WRAPPING
print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines"));
;
}
-static struct sigaction pager_oldaction, pager_newaction; /* Original and temporary handlers for SIGINT. */
-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? */
+static struct sigaction pager_oldaction, pager_newaction;
+ /* Original and temporary handlers for SIGINT. */
+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
* we finished the stdin pipe correctly or not. */
/* Initialize the signal handlers. */
void signal_init(void)
{
- /* Trap SIGINT and SIGQUIT because we want them to do useful
- * things. */
+ /* Trap SIGINT and SIGQUIT because we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
kill(0, SIGSTOP);
}
-/* the subnfunc version */
+/* The version of above function that is bound to a key. */
void do_suspend_void(void)
{
if (ISSET(SUSPEND))