mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 22:29:42 +03:00
Normalizing some whitespace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
0a79c78e05
commit
0b6d6f45d2
@ -6,6 +6,7 @@
|
||||
* src/search.c (do_replace_loop): Place a call to edit_refresh better,
|
||||
and remove two unneeded ones. This greatly speeds up nano when doing
|
||||
a Replace All with *lots* of occurrences.
|
||||
* src/{color,global,nano,text,utils}.c: Normalize some whitespace.
|
||||
|
||||
2015-03-25 Benno Schulenberg <bensberg@justemail.net>
|
||||
* doc/syntax/debian.nanorc: Slightly widen and relax the header regex.
|
||||
|
@ -269,9 +269,9 @@ void color_update(void)
|
||||
/* Open the magic database and get a diagnosis of the file. */
|
||||
cookie = magic_open(MAGIC_SYMLINK |
|
||||
#ifdef DEBUG
|
||||
MAGIC_DEBUG | MAGIC_CHECK |
|
||||
MAGIC_DEBUG | MAGIC_CHECK |
|
||||
#endif
|
||||
MAGIC_ERROR);
|
||||
MAGIC_ERROR);
|
||||
if (cookie == NULL || magic_load(cookie, NULL) < 0)
|
||||
statusbar(_("magic_load() failed: %s"), strerror(errno));
|
||||
else {
|
||||
|
142
src/global.c
142
src/global.c
@ -137,9 +137,9 @@ char *backup_dir = NULL;
|
||||
/* 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;
|
||||
@ -223,7 +223,7 @@ size_t length_of_list(int menu)
|
||||
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
|
||||
@ -374,7 +374,7 @@ int sc_seq_or(void (*func)(void), int defaultval)
|
||||
|
||||
if (s) {
|
||||
meta_key = (s->type == META);
|
||||
return s->seq;
|
||||
return s->seq;
|
||||
}
|
||||
/* else */
|
||||
return defaultval;
|
||||
@ -409,16 +409,16 @@ key_type strtokeytype(const char *str)
|
||||
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")))
|
||||
@ -650,9 +650,9 @@ void shortcut_init(void)
|
||||
#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. */
|
||||
@ -924,28 +924,28 @@ void shortcut_init(void)
|
||||
* 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
|
||||
@ -1221,44 +1221,44 @@ const subnfunc *sctofunc(sc *s)
|
||||
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 */
|
||||
@ -1571,7 +1571,7 @@ void thanks_for_all_the_fish(void)
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
if (backup_dir != NULL)
|
||||
free(backup_dir);
|
||||
free(backup_dir);
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
if (operating_dir != NULL)
|
||||
@ -1665,14 +1665,14 @@ void thanks_for_all_the_fish(void)
|
||||
#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)
|
||||
|
23
src/nano.c
23
src/nano.c
@ -719,9 +719,9 @@ void die_save_file(const char *die_filename
|
||||
_("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);
|
||||
@ -1145,8 +1145,8 @@ void do_exit(void)
|
||||
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
|
||||
@ -1282,9 +1282,8 @@ RETSIGTYPE handle_hupterm(int signal)
|
||||
/* Handler for SIGTSTP (suspend). */
|
||||
RETSIGTYPE do_suspend(int signal)
|
||||
{
|
||||
|
||||
if (ISSET(RESTRICTED)) {
|
||||
nano_disabled_msg();
|
||||
nano_disabled_msg();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1804,7 +1803,7 @@ int do_mouse(void)
|
||||
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);
|
||||
@ -2481,8 +2480,8 @@ int main(int argc, char **argv)
|
||||
do_rcfile();
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "After rebinding keys...\n");
|
||||
print_sclist();
|
||||
fprintf(stderr, "After rebinding keys...\n");
|
||||
print_sclist();
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
@ -2739,7 +2738,7 @@ int main(int argc, char **argv)
|
||||
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))
|
||||
@ -2824,7 +2823,7 @@ int main(int argc, char **argv)
|
||||
if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
|
||||
do_cursorpos(TRUE);
|
||||
|
||||
currmenu = MMAIN;
|
||||
currmenu = MMAIN;
|
||||
|
||||
/* Read in and interpret characters. */
|
||||
do_input(TRUE);
|
||||
|
@ -2246,8 +2246,8 @@ void do_justify(bool full_justify)
|
||||
* replaced with the unjustified paragraph. */
|
||||
unpartition_filestruct(&filepart);
|
||||
|
||||
/* Renumber starting with the beginning line of the old
|
||||
* partition. */
|
||||
/* Renumber, starting with the beginning line of the old
|
||||
* partition. */
|
||||
renumber(top_save);
|
||||
|
||||
/* Restore the justify we just did (ungrateful user!). */
|
||||
|
@ -643,7 +643,7 @@ filestruct *fsfromline(ssize_t lineno)
|
||||
for (; f->lineno != lineno && f != openfile->fileage; f = f->prev)
|
||||
;
|
||||
else
|
||||
for (; f->lineno != lineno && f->next != NULL; f = f->next)
|
||||
for (; f->lineno != lineno && f->next != NULL; f = f->next)
|
||||
;
|
||||
|
||||
if (f->lineno != lineno)
|
||||
|
Loading…
Reference in New Issue
Block a user