Menu

#2342 END key jumps to EOL but ignores CRLF/CR/LF and cuts them off

Bug
closed-invalid
nobody
5
2022-08-16
2022-08-06
Humangenom
No

I've created a bug report for Notepad++ but they said it's a bug in Scintilla and so I'm reporting it here.
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11979

Replace N++ with Scintilla in the description.

Description of the Issue

When I'm at the beginning of a line and I press END, N++ jumps to the end of the line but doesn't show the line endings when enabled. I have to manually scroll to the right to see the eol characters.
Steps to Reproduce the Issue

create some lines that are longer than the current width of the window
go to the beginning of the line
press END

Expected Behavior

N++ adds the with of the CRLF so I can see this characters also.
Actual Behavior

N++ shows the end of the line without CRLF characters.

Debug Information
Notepad++ v8.4.3 (64-bit)
Build time : Jul 7 2022 - 10:55:58
OS Name : Windows 11 (64-bit)
OS Version : 21H2
OS Build : 22000.795

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-08-06
    • labels: --> scintilla, caret
    • status: open --> open-invalid
     
  • Neil Hodgson

    Neil Hodgson - 2022-08-06

    This is the designed default behaviour. Its the same as not scrolling the next word into view when you move the caret right. The goal is for the caret to be visible.

    The behaviour can be modified with the caret policy. If you want some number of pixels (say 50) to be visible then use SCI_SETXCARETPOLICY(CARET_SLOP|CARET_STRICT, 50).

     
  • Humangenom

    Humangenom - 2022-08-10

    Thanks for the hint. I have posted your solution to Notepad++ and I'm waiting for the answer.

     
  • Humangenom

    Humangenom - 2022-08-13

    One more question, I don't know if it's a bug in N++, Scintilla or expected behavior by you.
    I can jump to the end and don't see the CRLF characters, I can scroll further to the right to see them.
    When I set the caret policy, I can see them when I press END, but the scrollbar now can scroll even further to the right which makes no sense to me.

     
    • Neil Hodgson

      Neil Hodgson - 2022-08-13

      Can you reproduce the effect in SciTE?

       
  • Humangenom

    Humangenom - 2022-08-14

    I can try if you tell me how to execute this policy at runtime like I do in N++.
    I've trie to edit SciTE.properties and added

    command.name.10.=setXCaretPolicy test
    command.mode.10.
    =subsystem:lua,savebefore:no
    command.10.*=editor:setXCaretPolicy(0x5,50)

    command.name.11.=test
    command.mode.11.
    =subsystem:lua,savebefore:no
    command.11.*=editor:SetSel(5,15)

    command.name.12.=Test print
    command.mode.12.
    =subsystem:lua,savebefore:no
    command.12.*=print ("Hello, World!")

    But only Test print works. The others do nothing.

     
  • Neil Hodgson

    Neil Hodgson - 2022-08-14

    SciTE provides settings for caret policy so there is no need to script that and your preference should be something like:

    caret.policy.xslop=1
    caret.policy.width=50
    caret.policy.xstrict=1
    caret.policy.xeven=0
    caret.policy.xjumps=0
    

    If you want to restrict the initial scroll range to be more like Notepad++, horizontal.scroll.width=100.

    The inline expressions don't work as they aren't seen by Lua as a function LUA_TFUNCTION. To make this work, they have to be wrapped in a function inside SciTEStartup.lua.

     
  • Humangenom

    Humangenom - 2022-08-16

    Okay, I tested it and the behavior looks good so it's a bug in N++ I think

     
  • Neil Hodgson

    Neil Hodgson - 2022-08-16
    • status: open-invalid --> closed-invalid
     

Log in to post a comment.