tweaks: adjust indentation after the previous change

Also improve a couple of comments.
master
Benno Schulenberg 2018-08-08 19:53:05 +02:00
parent 61b4eeda66
commit 94b4f07281
1 changed files with 28 additions and 27 deletions

View File

@ -2872,42 +2872,43 @@ const char *do_alt_speller(char *tempfile_name)
if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0) if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0)
return invocation_error(alt_speller); return invocation_error(alt_speller);
/* Stat the temporary file again, and only read it in when it changed. */ /* Stat the temporary file again. */
stat(tempfile_name, &spellfileinfo); stat(tempfile_name, &spellfileinfo);
/* Use the spell-checked file only when it changed. */
if (spellfileinfo.st_mtime != timestamp) { if (spellfileinfo.st_mtime != timestamp) {
#ifndef NANO_TINY #ifndef NANO_TINY
/* Replace the marked text (or the entire text) of the current buffer /* Replace the marked text (or entire text) with the corrected text. */
* with the spell-checked text. */ if (openfile->mark) {
if (openfile->mark) { filestruct *top, *bot;
filestruct *top, *bot; size_t top_x, bot_x;
size_t top_x, bot_x; bool right_side_up;
bool right_side_up; ssize_t was_mark_lineno = openfile->mark->lineno;
ssize_t was_mark_lineno = openfile->mark->lineno;
mark_order((const filestruct **)&top, &top_x, mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up); (const filestruct **)&bot, &bot_x, &right_side_up);
replace_marked_buffer(tempfile_name); replace_marked_buffer(tempfile_name);
/* Adjust the end point of the marked region for any change in /* Adjust the end point of the marked region for any change in
* length of the region's last line. */ * length of the region's last line. */
if (right_side_up) if (right_side_up)
current_x_save = openfile->current_x; current_x_save = openfile->current_x;
else else
openfile->mark_x = openfile->current_x; openfile->mark_x = openfile->current_x;
/* Restore the mark. */ /* Restore the mark. */
openfile->mark = fsfromline(was_mark_lineno); openfile->mark = fsfromline(was_mark_lineno);
} else } else
#endif #endif
replace_buffer(tempfile_name); replace_buffer(tempfile_name);
/* Go back to the old position. */ /* Go back to the old position. */
goto_line_posx(lineno_save, current_x_save); goto_line_posx(lineno_save, current_x_save);
if (was_at_eol || openfile->current_x > strlen(openfile->current->data)) if (was_at_eol || openfile->current_x > strlen(openfile->current->data))
openfile->current_x = strlen(openfile->current->data); openfile->current_x = strlen(openfile->current->data);
openfile->placewewant = pww_save; openfile->placewewant = pww_save;
adjust_viewport(STATIONARY); adjust_viewport(STATIONARY);
} }
#ifndef NANO_TINY #ifndef NANO_TINY