• Login
Community
  • Login

Auto scroll to bottom when turning on fail -f

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 318 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    Craig Silver
    last edited by Feb 28, 2025, 5:30 PM

    As a user, I want the option of the application to automatically scroll to the bottom of the current file when I click the fail -f button (the little eyeball), so that I don’t have to scroll to the bottom to see lines of text being added in real time.

    Ideally, there are two new preferences:

    1. Automatically scroll to the bottom when tail -f is first pressed
    2. Automatically scroll to the bottom when the file changes and tail -f is pressed

    If the user only has #1 checked, then it allows them to scroll around without it jumping to the bottom when the file is updated (until they scroll back to the bottom, which will resume auto scrolling when the file changes, which is the current behaviour, to my knowledge).

    I know the Ctrl+End takes me to the end of the document, but it is one extra keystroke that I have to do very often, and I figure this is something that a lot of people would appreciate (as an option).

    Also, I realize that there is already the following option:

    Settings > Preferences > MISC. > Scroll to the last line after update

    however, I don’t want that to occur unless the tail -f button is pressed.

    M P 3 Replies Last reply Feb 28, 2025, 8:09 PM Reply Quote 0
    • M
      mathlete2 @Craig Silver
      last edited by Feb 28, 2025, 8:09 PM

      @Craig-Silver said in Auto scroll to bottom when turning on fail -f:

      I realize that there is already the following option:

      Settings > Preferences > MISC. > Scroll to the last line after update

      however, I don’t want that to occur unless the tail -f button is pressed.

      What about using the File > Reload from Disk feature (Ctrl+R by default)?

      1 Reply Last reply Reply Quote 0
      • M
        mathlete2 @Craig Silver
        last edited by mathlete2 Feb 28, 2025, 8:21 PM Feb 28, 2025, 8:20 PM

        @Craig-Silver said in Auto scroll to bottom when turning on fail -f:

        however, I don’t want that to occur unless the tail -f button is pressed.

        Actually, reloading manually probably won’t help for that specific condition, so you might need to create a Macro that does both a Reload and a Ctrl+End.

        1 Reply Last reply Reply Quote 2
        • P
          PeterJones @Craig Silver
          last edited by PeterJones Mar 3, 2025, 2:30 PM Feb 28, 2025, 11:38 PM

          @Craig-Silver ,

          When you go into tail -f mode, it doesn’t immediately scroll to the bottom… but as soon as it sees that the file has been updated, it does scroll to the bottom.

          (I just tested in 8.7.5 with tail -f on, but MISC preferences set to not scroll to last line after update. My external process would create a file with 100 lines [so longer than my screen], then launch Notepad++ with the first file, then repeat on waiting 10s and printing the current time to the file; in that first 10s between launching N++ and writing the time, I would hit the tail -f toolbar button.)

          So, other than immediately scrolling to the bottom, it does most of what you want, in that once there is a change to the file, it will scroll.

          @mathlete2 ,

          tail -f already does the equivalent of a “Reload and Ctrl+End” every time the file is updated by the external process, so you are suggesting “create a macro to manually do what tail -f already does”, which seems really strange advice. Especially when the person asking already said they didn’t want to do any extra keystrokes, which your solution requires (to be able to run the macro).

          M C 2 Replies Last reply Mar 3, 2025, 1:33 PM Reply Quote 0
          • M
            mathlete2 @PeterJones
            last edited by mathlete2 Mar 3, 2025, 2:33 PM Mar 3, 2025, 1:33 PM

            @PeterJones yeah, that’s partly why I suggested simply reloading the document manually at first. However, I think I misinterpreted the last part of @Craig-Silver’s description (even the second time around): I had originally interpreted “pressed” as “toggled” (i.e. he was describing the state of the button at the time of the reload), but I see now that he meant the actual act of clicking the button.

            So, to revise my Macro suggestion: the actions should be:

            (1) toggle the tail -f button
            (2) apply a Ctrl+F End/SCI_DOCUMENTEND

            P 1 Reply Last reply Mar 3, 2025, 2:29 PM Reply Quote 0
            • P
              PeterJones @mathlete2
              last edited by Mar 3, 2025, 2:29 PM

              @mathlete2 said in Auto scroll to bottom when turning on fail -f:

              (2) apply a Ctrl+F/SCI_DOCUMENTEND

              Ctrl+F is FIND. That is never, by default, mapped to SCI_DOCUMENTEND. Usually Ctrl+END is mapped to that action.

              Please be more careful with your advice in the future.

              1 Reply Last reply Reply Quote 0
              • C
                Craig Silver @PeterJones
                last edited by Mar 16, 2025, 4:45 PM

                @PeterJones Apologies for the late response. I don’t normally check the email associated with this account.

                You’re right! I don’t know why I didn’t notice. This behaviour is more than sufficient for me. Thank you.

                @mathlete2 Thank you for your suggestions just the same.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors