/* The directory where we store backup files. */
const char *locking_prefix = ".";
- /* Prefix of how to store the vim-style lock file. */
+ /* Prefix of how to store the vim-style lock file. */
const char *locking_suffix = ".swp";
- /* Suffix of the vim-style lock file. */
+ /* Suffix of the vim-style lock file. */
#endif
#ifndef DISABLE_OPERATINGDIR
char *operating_dir = NULL;
size_t i = 0;
for (f = allfuncs; f != NULL; f = f->next)
- if ((f->menus & menu) != 0
+ if ((f->menus & menu) != 0
#ifndef DISABLE_HELP
&& strlen(f->help) > 0
#endif
if (s) {
meta_key = (s->type == META);
- return s->seq;
+ return s->seq;
}
/* else */
return defaultval;
void assign_keyinfo(sc *s)
{
if (s->type == CONTROL) {
- assert(strlen(s->keystr) > 1);
- s->seq = s->keystr[1] - 64;
+ assert(strlen(s->keystr) > 1);
+ s->seq = s->keystr[1] - 64;
} else if (s->type == META) {
- assert(strlen(s->keystr) > 2);
- s->seq = tolower((int) s->keystr[2]);
+ assert(strlen(s->keystr) > 2);
+ s->seq = tolower((int) s->keystr[2]);
} else if (s->type == FKEY) {
- assert(strlen(s->keystr) > 1);
- s->seq = KEY_F0 + atoi(&s->keystr[1]);
+ assert(strlen(s->keystr) > 1);
+ s->seq = KEY_F0 + atoi(&s->keystr[1]);
} else /* RAWINPUT */
- s->seq = (int) s->keystr[0];
+ s->seq = (int) s->keystr[0];
/* Override some keys which don't bind as easily as we'd like. */
if (s->type == CONTROL && (!strcasecmp(&s->keystr[1], "space")))
#endif
while (allfuncs != NULL) {
- subnfunc *f = allfuncs;
- allfuncs = allfuncs->next;
- free(f);
+ subnfunc *f = allfuncs;
+ allfuncs = allfuncs->next;
+ free(f);
}
/* Start populating the different menus with functions. */
* specified on the command line, and the fifth is useless since
* backups are disabled. */
if (!ISSET(RESTRICTED)) {
- add_to_funcs(dos_format_void, MWRITEFILE,
- N_("DOS Format"), IFSCHELP(nano_dos_msg), TOGETHER, NOVIEW);
+ add_to_funcs(dos_format_void, MWRITEFILE,
+ N_("DOS Format"), IFSCHELP(nano_dos_msg), TOGETHER, NOVIEW);
- add_to_funcs(mac_format_void, MWRITEFILE,
- N_("Mac Format"), IFSCHELP(nano_mac_msg), TOGETHER, NOVIEW);
+ add_to_funcs(mac_format_void, MWRITEFILE,
+ N_("Mac Format"), IFSCHELP(nano_mac_msg), TOGETHER, NOVIEW);
- add_to_funcs(append_void, MWRITEFILE,
- N_("Append"), IFSCHELP(nano_append_msg), TOGETHER, NOVIEW);
- add_to_funcs(prepend_void, MWRITEFILE,
- N_("Prepend"), IFSCHELP(nano_prepend_msg), TOGETHER, NOVIEW);
+ add_to_funcs(append_void, MWRITEFILE,
+ N_("Append"), IFSCHELP(nano_append_msg), TOGETHER, NOVIEW);
+ add_to_funcs(prepend_void, MWRITEFILE,
+ N_("Prepend"), IFSCHELP(nano_prepend_msg), TOGETHER, NOVIEW);
- add_to_funcs(backup_file_void, MWRITEFILE,
- N_("Backup File"), IFSCHELP(nano_backup_msg), TOGETHER, NOVIEW);
+ add_to_funcs(backup_file_void, MWRITEFILE,
+ N_("Backup File"), IFSCHELP(nano_backup_msg), TOGETHER, NOVIEW);
}
/* If we're using restricted mode, file insertion is disabled, and
* thus command execution and the multibuffer toggle have no place. */
if (!ISSET(RESTRICTED)) {
- add_to_funcs(flip_execute_void, MINSERTFILE,
+ add_to_funcs(flip_execute_void, MINSERTFILE,
N_("Execute Command"), IFSCHELP(nano_execute_msg), TOGETHER, NOVIEW);
- add_to_funcs(flip_execute_void, MEXTCMD,
+ add_to_funcs(flip_execute_void, MEXTCMD,
read_file_tag, IFSCHELP(nano_insert_msg), TOGETHER, NOVIEW);
#ifndef DISABLE_MULTIBUFFER
const char *flagtostr(int flag)
{
switch (flag) {
- case NO_HELP:
- /* TRANSLATORS: The next seventeen strings are toggle descriptions;
- * they are best kept shorter than 40 characters, but may be longer. */
- return N_("Help mode");
- case CONST_UPDATE:
- return N_("Constant cursor position display");
- case MORE_SPACE:
- return N_("Use of one more line for editing");
- case SMOOTH_SCROLL:
- return N_("Smooth scrolling");
- case SOFTWRAP:
- return N_("Soft wrapping of overlong lines");
- case WHITESPACE_DISPLAY:
- return N_("Whitespace display");
- case NO_COLOR_SYNTAX:
- return N_("Color syntax highlighting");
- case SMART_HOME:
- return N_("Smart home key");
- case AUTOINDENT:
- return N_("Auto indent");
- case CUT_TO_END:
- return N_("Cut to end");
- case NO_WRAP:
- return N_("Hard wrapping of overlong lines");
- case TABS_TO_SPACES:
- return N_("Conversion of typed tabs to spaces");
- case BACKUP_FILE:
- return N_("Backup files");
- case MULTIBUFFER:
- return N_("Multiple file buffers");
- case USE_MOUSE:
- return N_("Mouse support");
- case NO_CONVERT:
- return N_("No conversion from DOS/Mac format");
- case SUSPEND:
- return N_("Suspension");
- default:
- return "?????";
+ case NO_HELP:
+ /* TRANSLATORS: The next seventeen strings are toggle descriptions;
+ * they are best kept shorter than 40 characters, but may be longer. */
+ return N_("Help mode");
+ case CONST_UPDATE:
+ return N_("Constant cursor position display");
+ case MORE_SPACE:
+ return N_("Use of one more line for editing");
+ case SMOOTH_SCROLL:
+ return N_("Smooth scrolling");
+ case SOFTWRAP:
+ return N_("Soft wrapping of overlong lines");
+ case WHITESPACE_DISPLAY:
+ return N_("Whitespace display");
+ case NO_COLOR_SYNTAX:
+ return N_("Color syntax highlighting");
+ case SMART_HOME:
+ return N_("Smart home key");
+ case AUTOINDENT:
+ return N_("Auto indent");
+ case CUT_TO_END:
+ return N_("Cut to end");
+ case NO_WRAP:
+ return N_("Hard wrapping of overlong lines");
+ case TABS_TO_SPACES:
+ return N_("Conversion of typed tabs to spaces");
+ case BACKUP_FILE:
+ return N_("Backup files");
+ case MULTIBUFFER:
+ return N_("Multiple file buffers");
+ case USE_MOUSE:
+ return N_("Mouse support");
+ case NO_CONVERT:
+ return N_("No conversion from DOS/Mac format");
+ case SUSPEND:
+ return N_("Suspension");
+ default:
+ return "?????";
}
}
#endif /* !NANO_TINY */
#endif
#ifndef NANO_TINY
if (backup_dir != NULL)
- free(backup_dir);
+ free(backup_dir);
#endif
#ifndef DISABLE_OPERATINGDIR
if (operating_dir != NULL)
#endif
/* Free the functions and shortcuts lists. */
while (allfuncs != NULL) {
- subnfunc *f = allfuncs;
- allfuncs = allfuncs->next;
- free(f);
+ subnfunc *f = allfuncs;
+ allfuncs = allfuncs->next;
+ free(f);
}
while (sclist != NULL) {
- sc *s = sclist;
- sclist = sclist->next;
- free(s);
+ sc *s = sclist;
+ sclist = sclist->next;
+ free(s);
}
#ifndef DISABLE_NANORC
if (homedir != NULL)
_("Too many backup files?"));
#ifndef NANO_TINY
- /* Try and chmod/chown the save file to the values of the original file, but
- dont worry if it fails because we're supposed to be bailing as fast
- as possible. */
+ /* Try and chmod/chown the save file to the values of the original file,
+ * but don't worry if it fails because we're supposed to be bailing as
+ * fast as possible. */
if (die_stat) {
int shush;
shush = chmod(retval, die_stat->st_mode);
if (i == 0 || (i == 1 && do_writeout(TRUE))) {
#ifndef NANO_TINY
- if (ISSET(LOCKING) && openfile->lock_filename)
- delete_lockfile(openfile->lock_filename);
+ if (ISSET(LOCKING) && openfile->lock_filename)
+ delete_lockfile(openfile->lock_filename);
#endif
#ifndef DISABLE_MULTIBUFFER
/* Handler for SIGTSTP (suspend). */
RETSIGTYPE do_suspend(int signal)
{
-
if (ISSET(RESTRICTED)) {
- nano_disabled_msg();
+ nano_disabled_msg();
return;
}
mouse_x, (unsigned long)openfile->current_x);
#endif
} else {
- openfile->current_x = actual_x(openfile->current->data, mouse_x);
+ openfile->current_x = actual_x(openfile->current->data, mouse_x);
#ifdef DEBUG
fprintf(stderr, "do_mouse(): i <= mouse_y, mouse_x = %d, setting current_x to = %lu\n",
mouse_x, (unsigned long)openfile->current_x);
do_rcfile();
#ifdef DEBUG
- fprintf(stderr, "After rebinding keys...\n");
- print_sclist();
+ fprintf(stderr, "After rebinding keys...\n");
+ print_sclist();
#endif
#ifndef DISABLE_OPERATINGDIR
icol = 1;
}
#ifndef DISABLE_HISTORIES
- else {
+ else {
/* See if we have a POS history to use if we haven't overridden it. */
ssize_t savedposline, savedposcol;
if (check_poshistory(argv[i], &savedposline, &savedposcol))
if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
do_cursorpos(TRUE);
- currmenu = MMAIN;
+ currmenu = MMAIN;
/* Read in and interpret characters. */
do_input(TRUE);