Community
    • Login

    Scroll screen not getting the cursor to bottom or top

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.0k 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.
    • Chung-Suh KuC
      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
        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors