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
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)
.Thanks for the hint. I have posted your solution to Notepad++ and I'm waiting for the answer.
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.
Can you reproduce the effect in SciTE?
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.
SciTE provides settings for caret policy so there is no need to script that and your preference should be something like:
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 insideSciTEStartup.lua
.Okay, I tested it and the behavior looks good so it's a bug in N++ I think