nano

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

commit 42f307ef7562f5afd7fa1e54c21a49373249d366
parent 674ab835e8638f050237378c195040a5b7f19397
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon, 13 Jul 2015 17:57:58 +0000

(Putting in the original patch, from before I got overzealous.)
Removing an unneeded condition -- 'added_magicline' can only be
true when NO_NEWLINES isn't.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5297 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 4++++
Msrc/text.c | 13+++++--------
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +2015-07-13 Benno Schulenberg <bensberg@justemail.net> + * src/text.c (do_int_spell_fix, do_alt_speller): Remove an unneeded + condition; 'added_magicline' can only be true when NO_NEWLINES isn't. + 2015-07-12 Benno Schulenberg <bensberg@justemail.net> * src/text.c (do_alt_speller): Rename the variable 'totsize_save' to 'size_of_surrounding', to better describe what it contains. diff --git a/src/text.c b/src/text.c @@ -2418,9 +2418,8 @@ bool do_int_spell_fix(const char *word) #ifndef NANO_TINY if (old_mark_set) { - /* If the mark was on, the NO_NEWLINES flag isn't set, and we - * added a magicline, remove it now. */ - if (!ISSET(NO_NEWLINES) && added_magicline) + /* If a magicline was added, remove it again. */ + if (added_magicline) remove_magicline(); /* Put the beginning and the end of the mark at the beginning @@ -2753,8 +2752,7 @@ const char *do_alt_speller(char *tempfile_name) /* If the mark is on, partition the filestruct so that it * contains only the marked text; if the NO_NEWLINES flag isn't * set, keep track of whether the text will have a magicline - * added when we're done correcting misspelled words; and - * turn the mark off. */ + * added when we're done correcting misspelled words. */ mark_order((const filestruct **)&top, &top_x, (const filestruct **)&bot, &bot_x, &right_side_up); filepart = partition_filestruct(top, top_x, bot, bot_x); @@ -2780,9 +2778,8 @@ const char *do_alt_speller(char *tempfile_name) else openfile->mark_begin_x = strlen(openfile->filebot->data); - /* If the mark was on, the NO_NEWLINES flag isn't set, and we - * added a magicline, remove it now. */ - if (!ISSET(NO_NEWLINES) && added_magicline) + /* If a magicline was added, remove it again. */ + if (added_magicline) remove_magicline(); /* Unpartition the filestruct so that it contains all the text