Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change behavior of PageUp and PageDown keys #688

Closed
JFormDesigner opened this issue Feb 18, 2018 · 5 comments
Closed

Change behavior of PageUp and PageDown keys #688

JFormDesigner opened this issue Feb 18, 2018 · 5 comments
Assignees

Comments

@JFormDesigner
Copy link
Contributor

The behavior of the PageUp and PageDown keys in RichTextFX is IMO very unusual compared to other editors (Eclipse, IntelliJ IDEA, etc).

Let's say the text is 1000 lines long and there are 50 lines visible.

Pressing PageDown key in RichTextFX moves the caret down 50 lines and then scrolls the caret into the visible area. In case the caret was at the top, RichTextFx scrolls only one line down. The caret is then at the bottom of the visible area.

In other editors, the text always scrolls 50 lines down and the caret is also moved 50 lines down.

Would it be possible to change this in RichTextFX?

@JordanMartinez
Copy link
Contributor

Just to be clear, you're saying the new behavior should move viewport so that it goes from displaying lines B to D to displaying lines E to G, correct?

----------- < top of document
|A
|======= < top of viewport
|B       < first line in viewport
|C
|D       < last line in viewport
|======= < Bottom of viewport
|E
|F
|G
|------------- < bottom of document

I've wondered about this myself. I'm ok with changing it. If people want to change it back, they can override the default behavior to what it was before.

@JFormDesigner
Copy link
Contributor Author

Just to be clear, you're saying the new behavior should move viewport so that it goes from displaying lines B to D to displaying lines E to G, correct?

Yes, exactly.

@JordanMartinez
Copy link
Contributor

@JFormDesigner mind submitting a PR for this? Shouldn't be too hard.

@Jugen Jugen self-assigned this Nov 29, 2018
@JFormDesigner
Copy link
Contributor Author

@Jugen just noticed that you're self-assigned to this issue. Do you work on a PR?

Some weeks ago I've (partly) implemented this in Markdown Writer FX in this commit: JFormDesigner/markdown-writer-fx@4f5c45b

The MWFX implementation not complete. E.g. does not use GenericStyledArea.getTargetCaretOffset(), because it is private.

If you're not working on this, I would improve my code and submit a PR.

@Jugen Jugen assigned JFormDesigner and unassigned Jugen Dec 23, 2018
@Jugen
Copy link
Collaborator

Jugen commented Dec 23, 2018

@JFormDesigner no I'm not working on PR yet, so please go ahead ....

Jugen added a commit that referenced this issue May 20, 2019
Changed page up and down behavior and revised tests accordingly
@Jugen Jugen closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants