-
Notifications
You must be signed in to change notification settings - Fork 240
Description
Hello,
I'm currently experiencing an issue with CodeArea when using LineNumberFactory. Below, I'll describe the observed behavior, the expected behavior, and my investigation into the issue.
Observed Behavior
When CodeArea contains enough lines to require a vertical scroll bar:
- If the caret is positioned at the very first character (scrolled to the top) and I press Enter, a new line is added, and the view scrolls down, making line 2 the top line.
- Pressing Enter again keeps line 2 at the top, while newly added empty lines appear at the top.
Expected Behavior
I have noticed that this behavior is caused by LineNumberFactory. Without the line number factory:
- The second Enter press shifts line 3 to the top.
- Subsequent presses continue moving lines 4, 5, 6, etc., to the top.
The behavior I am trying to achieve is no scrolling at all in this specific case. Ideally:
- If the view is scrolled to the top-most position and the caret is placed on the first line, pressing Enter should not scroll. Line 1 should remain at the top.
Investigation
I am currently analyzing the code to determine where this scrolling behavior occurs when pressing Enter. My goal is either to fix the behavior or implement a workaround for my use case.
I thought someone here might have insights into the relevant section of the code, which would help save time in pinpointing the cause.
If I find additional details, I will update this issue accordingly.
Thank you in advance!
Best regards,
Syméon