Commit 1e0e235c authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

make do_int_spell_fix() and do_alt_speller() take the NO_NEWLINES flag

into account


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3108 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 22 additions and 17 deletions
+22 -17
...@@ -52,8 +52,9 @@ CVS code - ...@@ -52,8 +52,9 @@ CVS code -
magiclines to the ends of files. Changes to read_file(), magiclines to the ends of files. Changes to read_file(),
write_marked_file(), move_to_filestruct(), write_marked_file(), move_to_filestruct(),
copy_from_filestruct(), usage(), do_output(), main(), copy_from_filestruct(), usage(), do_output(), main(),
do_replace_loop(), do_delete(), nano.1, nanorc.5, nano.texi, do_replace_loop(), do_delete(), do_int_spell_fix(),
and nanorc.sample. (DLR, suggested by Jaime do_alt_speller(), nano.1, nanorc.5, nano.texi, and
nanorc.sample. (DLR, suggested by Jaime
<re2823@Safe-mail.net>) <re2823@Safe-mail.net>)
- Move functions specific to the file browser to their own - Move functions specific to the file browser to their own
source file, and adjust related variables accordingly. New source file, and adjust related variables accordingly. New
......
...@@ -1530,13 +1530,15 @@ bool do_int_spell_fix(const char *word) ...@@ -1530,13 +1530,15 @@ bool do_int_spell_fix(const char *word)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (old_mark_set) { if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it /* If the mark is on, partition the filestruct so that it
* contains only the marked text, keep track of whether the text * contains only the marked text; if the NO_NEWLINES flag isn't
* will have a magicline added when we're done correcting * set, keep track of whether the text will have a magicline
* misspelled words, and turn the mark off. */ * added when we're done correcting misspelled words; and
* turn the mark off. */
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);
filepart = partition_filestruct(top, top_x, bot, bot_x); filepart = partition_filestruct(top, top_x, bot, bot_x);
added_magicline = (openfile->filebot->data[0] != '\0'); if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0');
openfile->mark_set = FALSE; openfile->mark_set = FALSE;
} }
#endif #endif
...@@ -1585,9 +1587,9 @@ bool do_int_spell_fix(const char *word) ...@@ -1585,9 +1587,9 @@ bool do_int_spell_fix(const char *word)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (old_mark_set) { if (old_mark_set) {
/* If the mark was on and we added a magicline, remove it /* If the mark was on, the NO_NEWLINES flag isn't set, and we
* now. */ * added a magicline, remove it now. */
if (added_magicline) if (!ISSET(NO_NEWLINES) && added_magicline)
remove_magicline(); remove_magicline();
/* Put the beginning and the end of the mark at the beginning /* Put the beginning and the end of the mark at the beginning
...@@ -1932,14 +1934,16 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1932,14 +1934,16 @@ const char *do_alt_speller(char *tempfile_name)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (old_mark_set) { if (old_mark_set) {
/* If the mark was on, partition the filestruct so that it /* If the mark is on, partition the filestruct so that it
* contains only the marked text, and keep track of whether the * contains only the marked text; if the NO_NEWLINES flag isn't
* temp file (which should contain the spell-checked marked * set, keep track of whether the text will have a magicline
* text) will have a magicline added when it's reloaded. */ * added when we're done correcting misspelled words; and
* turn the mark off. */
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);
filepart = partition_filestruct(top, top_x, bot, bot_x); filepart = partition_filestruct(top, top_x, bot, bot_x);
added_magicline = (openfile->filebot->data[0] != '\0'); if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0');
/* Get the number of characters in the marked text, and subtract /* Get the number of characters in the marked text, and subtract
* it from the saved value of totsize. */ * it from the saved value of totsize. */
...@@ -1963,9 +1967,9 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1963,9 +1967,9 @@ const char *do_alt_speller(char *tempfile_name)
if (old_mark_set) { if (old_mark_set) {
filestruct *top_save = openfile->fileage; filestruct *top_save = openfile->fileage;
/* If the mark was on and we added a magicline, remove it /* If the mark was on, the NO_NEWLINES flag isn't set, and we
* now. */ * added a magicline, remove it now. */
if (added_magicline) if (!ISSET(NO_NEWLINES) && added_magicline)
remove_magicline(); remove_magicline();
/* Put the beginning and the end of the mark at the beginning /* Put the beginning and the end of the mark at the beginning
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment