Skip to main content

Comments

7 comments

  • Fletcher Penney

    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
  • macosxguru

    Thank you.

    I am going to try that out.

    macosxguru

    0
  • macosxguru

    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
  • Fletcher Penney

    It *seems* that the difference is whether left/right margins are set using `textContainerInset` or `lineFragmentPadding` on the `NSTextContainer`:

     

    https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextUILayer/Tasks/SetTextMargins.html

     

    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
  • macosxguru

    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
  • Fletcher Penney

    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
  • macosxguru

    Thank you so much.

    Will let you know what my experience is with the changes.

    macosxguru

    0

Please sign in to leave a comment.

Powered by Zendesk