-
Notifications
You must be signed in to change notification settings - Fork 237
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
Feature request: Caret line position vs. paragraph position #386
Comments
Good point.
In other words, a paragraph that spans multiple lines is wrapped should move the caret to the start of the current line, not the paragraph itself. However, does a normal JavaFX
Such a request would probably need to expose more of |
Correct; however, I'm not sure how JavaFX TextArea behaves -- I imagine that it distinguishes lines from paragraphs as that has been typical UI behaviour for editing text since 1978 or so. ;-) |
😄 I just tested it and you're right. |
Probably don't want delegation here. Asking the editor's line number should give the line number from the top of the text area (starting from line 1), not the current paragraph. Also, using natural numbers seems like a good fit, as opposed to whole numbers, for line numbers. |
The methods lineStart and lineEnd move the cursor to the start and end of the paragraph, not the line. Their names should be changed to
paragraphStart
andparagraphEnd
to avoid confusion, as well as renaming selectLine toselectParagraph
.When pressing either
Home
orEnd
, the caret position should change relative to the current line, not the current paragraph, which is what users have come to expect (e.g., the text area used to write this message has typical home/end key behaviour). There are a few related issues: #384 and #360.It would be convenient if there was a
getLineNumber()
method that indicated the line number within the current paragraph, such as:Or:
Once
lineStart
andlineEnd
provide line-level values (instead of paragraph), it implies that writing a key interceptor for cutting a line (e.g., typingCtrl+x
as per IDE behaviour) should be as simple as:Or, pie-in-the-sky, to avoid extraneous UI updates:
This would also make it trivial to override the default Home/End behaviour to move the cursor to the start and end of lines, rather than paragraphs.
The text was updated successfully, but these errors were encountered: