Auto scroll to bottom when turning on fail -f
-
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:
- Automatically scroll to the bottom when tail -f is first pressed
- 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.
-
@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)?
-
@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.
-
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.
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). -
@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 aCtrl
+F
End
/SCI_DOCUMENTEND
-
@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 toSCI_DOCUMENTEND
. UsuallyCtrl+END
is mapped to that action.Please be more careful with your advice in the future.
-
@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.