Scroll screen not getting the cursor to bottom or top
-
Can I have the screen scrolled without the cursor getting the top or bottom line? If no more lines, i.e., first or end of file, are left, cursor can get to top or bottom. Normally before the cursor gets the bottom/top line of screen, the screen is scrolled. So I can preview 2~3 lines. Scroll window value is used for how many lines are shown. I can’t find any option related to this.
-
Yes. There are Scintilla commands to set this.
https://www.scintilla.org/ScintillaDoc.html#ScrollingAndAutomaticScrollingThis one is needed:
SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)Though I am not sure how to make it auto-run in NPP directly.
I only know how to do it using the PythonScript plugin.
https://github.com/bruderstein/PythonScriptIf you have it installed, then open “startup.py” script and put these lines
somewhere in the bottom:editor.setEndAtLastLine(0) editor.setYCaretPolicy(13, 5) # set scroll offset to 5Also set “Initialization: ATSTARTUP” in the plugin Configurarion menu.
This will set scroll offset to 5 lines (so change 5 in the second line to something else if needed).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login