Text selection behavior
CompletedI have three movies in this collection.
Selecting text in Sublime Text 3.
Selecting text in Ulysses.
Selecting text in nvUltra.
The board doesn't let me upload movies to it. I have uploaded the movies to Firefox Send and you can get them from https://send.firefox.com/download/512cdacdf0edb947/#JKu0g2zJD25SjsWgs8eiQg
It is available there for 7 days.
Tell me what you think.
macosxguru
-
I can experiment with different ways of adjusting where the text is located.
For now, you can decrease the left/right padding in the appearance preferences, and then add "leftIndent" and "rightIndent" attributes to your theme to offset those changes.
For example, if the left/right padding is 40 (default), then change that to 0 and add "leftIndent" and "rightIndent" values of 40 to your theme (you will also have to add them for codeBlocks and some other block types). The net result will be the same, but this allows you to select text using the empty margins on the left or right side of the text.
0 -
Thank you.
I am going to try that out.
macosxguru
0 -
I haven't tried it out yet. However I notice that the behavior in MultiMarkdown Composer is similar to Ulysses and Sublime Text. The behavior of nvUltra is unique.
Replicating the settings for left/right padding in preferences in nvUltra from MultiMarkdown Composer doesn't make a difference.
macosxguru
0 -
It *seems* that the difference is whether left/right margins are set using `textContainerInset` or `lineFragmentPadding` on the `NSTextContainer`:
MMD Composer used `lineFragmentPadding` for left/right margins and `textContainerInset` for vertical margins. This was more a fluke of the example code I saw when I created the first version of Composer than an intentional decision. While much of the code was rewritten in later versions, some parts were copied or rewritten using existing code as the template, which would include this part.
When rewriting the code this year (which is what is in use in nvUltra), I started from scratch and tried to do things "the right way." This version is vastly different from prior versions. Reviewing the page cited above, it states that `lineFragmentPadding` is "meant to specify a small amount of blank space on each end of the line fragment rectangles in which the typesetter sets lines of text."
It's hard to tell from that page whether using lineFragmentPadding to create actual margins is an abuse or not, which means I am not sure whether there are downstream effects (performance issues??) or not.
I welcome actual "definitive" input on this (e.g. references to Apple documentation, not just examples of what other applications do.) In a quick test, I can establish the visual margins either way, but I would like a better reason to make the change than "just because." ;)
That said, there *may* be some other reasons for me to consider changing to `lineFragmentPadding` (which I don't want to get into right now), which would make the discussion moot from a practical standpoint. But it would still be useful to know the right way to do this.
0 -
You are now deep into issues I have no idea about.
I must admit though that the inability to select text by clicking on the margins of the text window is a tad unnerving and something I am having difficulty to adjust to.
I am going to have to manipulate the themes and come up with a solution one of these days.
macosxguru
0 -
After digging around and asking others, it seems that others are using/abusing lineFragmentPadding in order to add left/right margins to NSTextView. So I have done this, which adds the requested ability to select and drag outside the actual text.
This will be in the next release. Let me know if anything strange seems to happen.0 -
Thank you so much.
Will let you know what my experience is with the changes.
macosxguru
0
Please sign in to leave a comment.
Comments
7 comments