bugGNU nano - Bugs: bug #54721, after invoking help, the internal...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #54721: after invoking help, the internal spell checker no longer spotlights the misspelled word

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Mon 24 Sep 2018 07:37:29 PM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  David Lawrence Ramsey <dolorous> Open/Closed:  Closed

( Jump to the original submission)

Wed 10 Oct 2018 05:46:14 PM UTC, comment #9: 

No problem.  And yes, I know it's a seldomly used case, but extending spotlighting may very well allow spotlighting to be used elsewhere under similar circumstances in the future :)

David Lawrence Ramsey <dolorous>
Project MemberIn charge of this item.
Tue 09 Oct 2018 06:11:00 PM UTC, comment #8: 

Ah.  I hadn't thought of a help screen being in fact a buffer.  :|

But... it is rather easy to guard against that: !inhelp.

So, after changing that, and renaming two variables, I've pushed your patches, commits c2e4f775 and 53865ced.

Thanks for fixing this.  It does look better when a word stays highlighted even after invoking help -- however seldom it will be used.

Benno Schulenberg <bens>
Project Administrator
Tue 09 Oct 2018 01:24:56 PM UTC, comment #7: 

Okay.  Attached a new version that makes the variables global, and resyncs it against git 7ea6d6b.

It does add a bit of complexity relative to the previous version, though, since spotlighting has to be manually switched off when entering the help viewer (the text of which is displayed in a different buffer), and manually switched back on when exiting it.

(file #45168)

David Lawrence Ramsey <dolorous>
Project MemberIn charge of this item.
Mon 08 Oct 2018 03:25:03 PM UTC, comment #6: 

Hi David,

Sorry for postponing to look at this patch.  I thought it would be intrusive and kept delaying... But it turns out to be relatively straightforward.

However, what I don't like is that it adds three elements to the openfile struct.  I don't think that is needed, because whenever the spotlight is active, it is impossible to switch to another buffer: you first have to end the "spotlighting session" before you can switch buffers.  So... I think the three variables should simply be global.

Benno Schulenberg <bens>
Project Administrator
Sat 29 Sep 2018 04:37:38 PM UTC, comment #5: 

Losing the highlight isn't that minor if you're making a lot of changes, and then forget where you were momentarily.

The attached 2-patch set against f4c958e should fix it (albeit crudely).  It moves spotlight handling into the update_line() functions, so that spotlights are set much like the mark used to be.  You set openfile->spotlighted to TRUE, and openfile->spotlighted_from_col and openfile->spotlighted_to_col to the starting and ending columns of the highlight, and the next screen redraw will do the spotlighting.  Setting openfile->spotlighted to FALSE will turn it back off.

Eventually, spotlight()'s functionality might be able to be moved into the update_line() functions, and having it in the openfilestruct means that it could be kept between multiple buffers for some use case I haven't thought of yet, but that kind of cleanup is much more involved (and I don't have the time to do it, for the same reason I haven't gotten to a better attempt at patch #9414).  This at least seems to work in the meantime.

(file #45118)

David Lawrence Ramsey <dolorous>
Project MemberIn charge of this item.
Sat 29 Sep 2018 07:06:08 AM UTC, comment #4: 

Okay, the mishighlighting of half a paragraph as the "misspelled word" has been fixed.  All that remains is the not re-highlighting of the misspelled word.  I don't know whether it is worth trying to fix that.  The mishighlighting was an obvious in-your-face error; the not-re-highlighting is a minor inconvenience.

Benno Schulenberg <bens>
Project Administrator
Wed 26 Sep 2018 05:59:15 PM UTC, comment #3: 

Sure.

And I'm aware that the patch doesn't keep the spotlighted text highlighted properly; that's why I said it fixed half the problem, the half where the mark seemed to disappear during an internal spell-check.  The other half of the problem, keeping the spotlighted text spotlighted after returning from help, is much more complicated.

David Lawrence Ramsey <dolorous>
Project MemberIn charge of this item.
Wed 26 Sep 2018 05:49:26 PM UTC, comment #2: 

Thanks for the patch.  But... it does not keep the spotlighted text highlighted properly.  It does avoid erronously highlighting part of the selected text, which is a small improvement, but it does not re-spotlight the misspelled word for which a replacement is being asked.  So it makes a marked and unmarked internal spell check behave the same way (which is: droping the spotlight after the help text was invoked), and that is better than two divergent behaviors.  So I have pushed your patch anyway: commit bed99717.

(The marked text will be rehighlighted properly anyhow after exiting from the internal spell check, also without your patch.)

Benno Schulenberg <bens>
Project Administrator
Tue 25 Sep 2018 12:20:07 AM UTC, comment #1: 

The attached patch (against git c545438) should keep the marked text highlighted properly, which is half the problem.

(file #45089)

David Lawrence Ramsey <dolorous>
Project MemberIn charge of this item.
Mon 24 Sep 2018 07:37:29 PM UTC, original submission:  

To reproduce, run 'src/nano --ignore NEWS'.  Then type <Ctrl+Shift+Down>.  See that the first paragraph is highlighted.  Now type ^T for a spell check.  See that it highlights the word "comme" and asks on the prompt bar to edit a replacement.  Ignore this and type ^G ^X.  Oww!  Now it highlights not just "comme" but the whole of the first paragraph starting from "comme".  :|

(When doing a spell check of the entire file, after a ^G ^X the word that was highlighted is not highlighted any more.)

Expected behavior: after returning from the help text, things should be highlighted the same way as before invoking help.

Benno Schulenberg <bens>
Project Administrator

 

Attached Files
file #45168:  nano-highlight.zip added by dolorous (4KiB - application/zip)
file #45118:  nano-highlight.zip added by dolorous (3KiB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dolorous (Updated the item)
  • -email is unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-12 bens Open/ClosedOpen => Closed
    2018-10-09 bens StatusIn Progress => Fixed
    2018-10-09 dolorous Attached File- => Added nano-highlight.zip, #45168
    2018-10-08 bens StatusNone => In Progress
        Assigned toNone => dolorous
    2018-09-29 dolorous Attached File- => Added nano-highlight.zip, #45118
    2018-09-29 bens Severity3 - Normal => 2 - Minor
        Summaryafter invoking help, the internal spell checker mishighlights things => after invoking help, the internal spell checker no longer spotlights the misspelled word
    2018-09-25 dolorous Attached File- => Added 0001-speller-restore-the-mark-coordinates-slightly-later.patch, #45089

    Back to the top


    Powered by Savane 3.5