Commit bde3e0e2 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in both the internal and alternate spell checker, put the beginning and

the end of the mark at the beginning and the end of the spell-checked
text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2073 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 22 additions and 14 deletions
+22 -14
...@@ -1616,21 +1616,25 @@ bool do_int_spell_fix(const char *word) ...@@ -1616,21 +1616,25 @@ bool do_int_spell_fix(const char *word)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (old_mark_set) { if (old_mark_set) {
size_t bot_data_len; size_t top_data_len, bot_data_len;
/* If we added a magicline, remove it now. */ /* If we added a magicline, remove it now. */
if (added_magicline) if (added_magicline)
remove_magicline(); remove_magicline();
/* If the mark ended in the middle of a word and that word was /* Put the beginning and the end of the mark at the beginning
* spell-checked, put either current_x_save or mark_beginx, * and the end of the spell-checked text. */
* depending on the value of right_side_up, at the end of the top_data_len = strlen(filepart->top_data);
* spell-checked word. */
bot_data_len = strlen(filebot->data); bot_data_len = strlen(filebot->data);
if (right_side_up) if (fileage == filebot)
bot_data_len += top_data_len;
if (right_side_up) {
mark_beginx = top_data_len;
current_x_save = bot_data_len; current_x_save = bot_data_len;
else } else {
current_x_save = top_data_len;
mark_beginx = bot_data_len; mark_beginx = bot_data_len;
}
/* If the mark was on, unpartition the filestruct so that it /* If the mark was on, unpartition the filestruct so that it
* contains all the text again, and turn the mark back on. */ * contains all the text again, and turn the mark back on. */
...@@ -1980,21 +1984,25 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1980,21 +1984,25 @@ const char *do_alt_speller(char *tempfile_name)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (old_mark_set) { if (old_mark_set) {
filestruct *top_save = fileage; filestruct *top_save = fileage;
size_t bot_data_len; size_t top_data_len, bot_data_len;
/* If we added a magicline, remove it now. */ /* If we added a magicline, remove it now. */
if (added_magicline) if (added_magicline)
remove_magicline(); remove_magicline();
/* If the mark ended in the middle of a word and that word was /* Put the beginning and the end of the mark at the beginning
* spell-checked, put either current_x_save or mark_beginx, * and the end of the spell-checked text. */
* depending on the value of right_side_up, at the end of the top_data_len = strlen(filepart->top_data);
* spell-checked word. */
bot_data_len = strlen(filebot->data); bot_data_len = strlen(filebot->data);
if (right_side_up) if (fileage == filebot)
bot_data_len += top_data_len;
if (right_side_up) {
mark_beginx = top_data_len;
current_x_save = bot_data_len; current_x_save = bot_data_len;
else } else {
current_x_save = top_data_len;
mark_beginx = bot_data_len; mark_beginx = bot_data_len;
}
/* If the mark was on, unpartition the filestruct so that it /* If the mark was on, unpartition the filestruct so that it
* contains all the text again. Note that we've replaced the * contains all the text again. Note that we've replaced the
......
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