1
1

Fixing a mistaken message plus a few comments too.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
Benno Schulenberg 2015-03-14 20:17:21 +00:00
родитель 4d9b5e92b3
Коммит 69d26c35fb
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,6 @@
2015-03-14 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_formatter): Fix a message plus a few comments.
2015-03-14 Mark Majeres <mark@engine12.com> 2015-03-14 Mark Majeres <mark@engine12.com>
* src/nano.c (renumber): Get out if there is nothing to renumber. * src/nano.c (renumber): Get out if there is nothing to renumber.
This prevents do_undo() from falling over when trying to renumber This prevents do_undo() from falling over when trying to renumber

Просмотреть файл

@ -3229,7 +3229,7 @@ free_lints_and_return:
/* Run a formatter for the given syntax. /* Run a formatter for the given syntax.
* Expects the formatter to be non-interactive and * Expects the formatter to be non-interactive and
* operate on a file in-place, which we'll pass it * operate on a file in-place, which we'll pass it
* on the command line. Another mashuhp of the speller * on the command line. Another mashup of the speller
* and alt_speller routines. * and alt_speller routines.
*/ */
void do_formatter(void) void do_formatter(void)
@ -3249,10 +3249,9 @@ void do_formatter(void)
char *finalstatus = NULL; char *finalstatus = NULL;
/* Check whether we're using syntax highlighting /* Check whether we're using syntax highlighting
* and formatter option it set * and the formatter option is set. */
*/
if (openfile->syntax == NULL || openfile->syntax->formatter == NULL) { if (openfile->syntax == NULL || openfile->syntax->formatter == NULL) {
statusbar(_("Error: no linter defined")); statusbar(_("Error: no formatter defined"));
return; return;
} }
@ -3266,7 +3265,7 @@ void do_formatter(void)
return; return;
} }
/* we're not supporting partial formatting, oi vey */ /* We're not supporting partial formatting, oi vey. */
openfile->mark_set = FALSE; openfile->mark_set = FALSE;
status = write_file(temp, temp_file, TRUE, OVERWRITE, FALSE); status = write_file(temp, temp_file, TRUE, OVERWRITE, FALSE);
@ -3304,10 +3303,10 @@ void do_formatter(void)
/* Start a new process for the formatter. */ /* Start a new process for the formatter. */
if ((pid_format = fork()) == 0) { if ((pid_format = fork()) == 0) {
/* Start alternate format program; we are using $PATH. */ /* Start the formatting program; we are using $PATH. */
execvp(formatargs[0], formatargs); execvp(formatargs[0], formatargs);
/* Should not be reached, if alternate formatter is found!!! */ /* Should not be reached, if the formatter is found! */
exit(1); exit(1);
} }
@ -3350,9 +3349,7 @@ void do_formatter(void)
sprintf(format_error, invoke_error, openfile->syntax->formatter); sprintf(format_error, invoke_error, openfile->syntax->formatter);
finalstatus = format_error; finalstatus = format_error;
} else { } else {
/* Replace the text of the current buffer with the formatted text. */
/* Replace the text of the current buffer with the format-checked
* text. */
replace_buffer(temp); replace_buffer(temp);
/* Go back to the old position, and mark the file as modified. */ /* Go back to the old position, and mark the file as modified. */
@ -3372,7 +3369,7 @@ void do_formatter(void)
currmenu = MMAIN; currmenu = MMAIN;
/* If the spell-checker printed any error messages onscreen, make /* If the formatter printed any error messages onscreen, make
* sure that they're cleared off. */ * sure that they're cleared off. */
total_refresh(); total_refresh();