nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 1536a76cedaa8186ffe1529249569f9e3a999167
parent d2fb371fe2ec8c5e39bbd3aba50e8f6fd36ea64e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 10 Oct 2019 14:05:49 +0200

tweaks: normalize the indentation after the previous change

Diffstat:
Msrc/text.c | 56++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -2607,38 +2607,38 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling) } #ifndef NANO_TINY - /* Replace the marked text (or entire text) with the corrected text. */ - if (openfile->mark) { - bool upright = (openfile->mark->lineno < openfile->current->lineno || - (openfile->mark == openfile->current && - openfile->mark_x < openfile->current_x)); - ssize_t was_mark_lineno = openfile->mark->lineno; - - replaced = replace_buffer(tempfile_name, CUT, TRUE, msg); - - /* Adjust the end point of the marked region for any change in - * length of the region's last line. */ - if (upright) - current_x_save = openfile->current_x; - else - openfile->mark_x = openfile->current_x; - - /* Restore the mark. */ - openfile->mark = line_from_number(was_mark_lineno); - } else + /* Replace the marked text (or entire text) with the corrected text. */ + if (openfile->mark) { + bool upright = (openfile->mark->lineno < openfile->current->lineno || + (openfile->mark == openfile->current && + openfile->mark_x < openfile->current_x)); + ssize_t was_mark_lineno = openfile->mark->lineno; + + replaced = replace_buffer(tempfile_name, CUT, TRUE, msg); + + /* Adjust the end point of the marked region for any change in + * length of the region's last line. */ + if (upright) + current_x_save = openfile->current_x; + else + openfile->mark_x = openfile->current_x; + + /* Restore the mark. */ + openfile->mark = line_from_number(was_mark_lineno); + } else #endif - replaced = replace_buffer(tempfile_name, CUT_TO_EOF, FALSE, msg); + replaced = replace_buffer(tempfile_name, CUT_TO_EOF, FALSE, msg); - /* Go back to the old position. */ - goto_line_posx(lineno_save, current_x_save); - if (was_at_eol || openfile->current_x > strlen(openfile->current->data)) - openfile->current_x = strlen(openfile->current->data); + /* Go back to the old position. */ + goto_line_posx(lineno_save, current_x_save); + if (was_at_eol || openfile->current_x > strlen(openfile->current->data)) + openfile->current_x = strlen(openfile->current->data); #ifndef NANO_TINY - if (replaced) - update_undo(COUPLE_END); + if (replaced) + update_undo(COUPLE_END); #endif - openfile->placewewant = pww_save; - adjust_viewport(STATIONARY); + openfile->placewewant = pww_save; + adjust_viewport(STATIONARY); if (spelling) statusbar(_("Finished checking spelling"));