Community
    • Login

    Scroll screen not getting the cursor to bottom or top

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.3k Views 1 Watching
    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.
    • Chung-Suh KuC Offline
      Chung-Suh Ku
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • Mikhail VM Offline
        Mikhail V
        last edited by

        Yes. There are Scintilla commands to set this.
        https://www.scintilla.org/ScintillaDoc.html#ScrollingAndAutomaticScrolling

        This 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/PythonScript

        If 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 5 
        

        Also 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).

        1 Reply Last reply Reply Quote 1

        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors