bugGNU nano - Bugs: bug #54754, when linter shows "first/last...


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

bug #54754: when linter shows "first/last message", there is no direct way to show message again

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 29 Sep 2018 07:38:45 AM UTC  
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

( Jump to the original submission)

Mon 22 Oct 2018 06:45:34 PM UTC, comment #7: 

I was going to say that this is too small an issue to bother with, but I like the improved behavior, and it costs just a few lines, so I've applied and pushed the patch, commit 71de0b9e.  Thanks.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 22 Oct 2018 01:29:51 AM UTC, comment #6: 

That is better than the other patches, except it has a bug that needs to be fixed.

When holding down a key, to quickly return to first or last message, the napms() is called repeatedly and creates a very long delay that freezes nano. The attached patch fixes it by storing the time of the last pause and only pausing if the time (in seconds) has changed. It would be better if millisecond time was used but using seconds is simple and only adds an extra 600ms delay if the first delay is at the end of a second.

(file #45255)

Brand Huntsman <brand>
Sun 21 Oct 2018 04:02:46 PM UTC, comment #5: 

Neither of the patches works for me.  (Although I don't understand why the one from Brand doesn't work.)  So I have pushed a different change, mostly similar to what David posted: commit b8c51329.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 18 Oct 2018 09:32:01 PM UTC, comment #4: 

extendsyntax c linter "gcc -fsyntax-only"

Putting that line in your nanorc will enable linter for C, and you can test with the nano C files. As far as I know, no support needs to be added to gcc for this to work.

I actually had the same idea as you, came here to post it and saw that you had already made a patch. Using a timer to restore linter message would be nice, but it would need to be combined with the keypress patch for the those who don't want to wait for a timer to expire. If at_first||at_last the get keypress could set a timeout of 3s, and then clear at_first, at_last and tmplint if time expires.

Brand Huntsman <brand>
Thu 18 Oct 2018 06:53:10 PM UTC, comment #3: 

Yes, I have gcc.  As I said before, I have no way to test it without installing a linter and programming language that I don't use.  My intent was to just display the "first/last line" message, delay a bit, and then display the message from before; I forgot that warn_and_shortly_pause() does more than delay.  I suppose I shouldn't have bothered with my patch here, then.

David Lawrence Ramsey <dolorous>
Project Member
Thu 18 Oct 2018 01:42:19 PM UTC, comment #2: 

Do you have gcc?

extendsyntax c linter "gcc -fsyntax-only"

Your patch changes statusbar to errorcolor and beeps, not sure if either are appropriate. It also prevents further linter messages from being displayed.

int foo(){int a = "";}

That creates the single linter message and does get stuck.

With the attached patch, you can move up/down to re-show the current message.

(file #45235)

Brand Huntsman <brand>
Wed 17 Oct 2018 05:13:45 PM UTC, comment #1: 

Would something like the attached work?

(Note that I don't really use the linter, since I don't have any of the predefined ones installed for the languages I program in, so take this with a grain of salt; I can't really test it.  I'm also not certain of the delay amount, since there are several uses of napms() with different values throughout the code, and I can't figure out a pattern for the delay amount in some cases.)

(file #45224)

David Lawrence Ramsey <dolorous>
Project Member
Sat 29 Sep 2018 07:38:45 AM UTC, original submission:  

When using the linter [surprisingly it is quite hard to get used to M-B for accessing the linter], and with ^Y or ^V you tried to go beyond the first or last message, the helpful report from the linter that this is the first or last message stays on screen and "hides" the actual linting message.  When there are multiple messages, it is easy to see the first/last message again by jumping one message in the other direction and then jumping back, but when there is just one message this is impossible: the status bar would alternate between "This is the first message" and "This is the last message".  The pnly way to get the message back then would be to exit from the linter and invoke it again.

(I haven't found a file that produces just one linting message, but in theory this should be possible.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by brand (Updated the item)
  • -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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-12 bens Open/ClosedOpen => Closed
    2018-10-22 brand Attached File- => Added 0001-linter-throttle-first-last-message-on-key-repeat.patch, #45255
    2018-10-21 bens StatusNone => Fixed
        Assigned toNone => bens
    2018-10-18 brand Attached File- => Added 0001-linter-re-show-current-message-on-prev-next-keypress.patch, #45235
    2018-10-17 dolorous Attached File- => Added 0001-linter-after-indicating-first-last-message-display-i.patch, #45224

    Back to the top

    Powered by Savane 3.5