NSTextView paragraph style of newline - cocoa

I've been playing around with NSTextView and have applied some paragraph styles to certain lines. However, when I type enter and get a new line, the attributes that I applied to one line are bleeding into the next.
I want to be able to apply a paragraph style to one line and have the next line be formatted in the default way. You can see what I mean from the screenshots.
When I add some spacing between paragraphs via NSParagraphStyle, the same spacing applies to the newline, which makes the whole thing look pretty shotty. Basically, I am looking for a way to reset the paragraph style for an empty line.
I have tried [MyTextView resetTypingAttributes:theAttributes] to no avail, since you first have to start typing for the new attributes to apply. Just to be clear, the line below the text in the screenshot is the cursor, which is really far down there as a result of the paragraph spacing.
Screenshot:

It seems that you have to use setTypingAttributes on the textview.

Related

How to sort emails data using its color codes in emeditor

I have this little challenge.
I want to ask, how do i sort the emails using the color code (light green) as stated in this picture here
I have tried to remove the non emails by scrolling through, but i need a solution that can make it a one click through sorting.
I will appreciate your kind response.
Open the Replace dialog box and enter the following regex in the Find field:
^((.*#[^\.]*)|([^#]+))$\n
Change the radio button to Regular Expressions. This regex pattern finds any line without a dot after # or any line without a #. Note that you need the last line of the document to be empty as shown in line 7 of your document.
Since we are deleting those lines, the "Replace with" field is blank. Now click Replace All.

GREP for end of text symbol

I need to go through and join hundreds of separate text frames into a unified text thread. The problem is that when I link the frames the style of the first paragraph of the frame I'm linking to ofter changes to the style of the last paragraph in the text frame I'm linking from. If I could put a frame break into the end of every text frame I could avoid this problem. The hidden character for 'end of text' looks like a hashtag. Is there a GREP for this?
Just found on the Adobe forums that \z is the character I want, and it does find all the instances, but when I try to change them for page breaks I crash my programme. Every damn time.
You can't only search for a single location placeholder with InDesign's GREP (it has its wings clipped) – although it should not have made it crash. Change the Keep Settings for every first paragraph in your stories to start in a new frame, it'll have the same result when joining.
You can use GREP for this as well. Search for
\A.
and leave the Change To field blank. In the Change To formatting field, set your new Keep options. \A matches Start of Story, and the single . is so you actually can find a (any) character so it won't crash on you again.
So I did this in the end which achieved what I wanted:
Find: (.)(\z)
Change to: $1~R
This way when I linked the text frames the styles didn't get changed.
Thanks for everyone's help, esp. user1754036 for the link to InDesign Secrets which really solved the puzzle for me.

Xamarin.UWP RichTextBlock Hanging Indentation

I used custom renderer to display a Label as RichTextBlock. Using Paragraph, there is a TextIndentProperty to indent first line. However, I also need "Hanging Indentation" found in RichEditBox or SetIndent found in ITextParagraphFormat.
Is there a way to implemnent "Hanging Indentation" in RichTextBlock?
I have found the solution to this question.
Use left-padding to shift the entire paragraph in (say 10px)
Then, use text-indent with negative value to shift the first line of the paragraph out again (say -10px).
With this method, a hanging indentation can be achieved.

How do you make a bullet point with a double bullet character in InDesign?

I have a bulleted list in InDesign but I want the bullet character to be shown twice.
I'm using the / character, so I want it to appear like // like a comment. I can't figure it out. I have the bullet a different colour/style as the text following it, so I don't want to "hard-code" it in either.
Sorry for the trolls fellow. Your question isn't a programming question, which is why you got a downvote.
However, to help you out, try using a font for your bullet point that has a glyph that you like - you can use any character for the bullets, you know.
Or, if you create a new paragraph style, you can go into the Paragraph Style Options under Bullets and Numbering. Now, where it says Text After you can enter another bullet character there. But you'll have to also create a character style to set it to the right font to show your bullet character.

Disable wrapping for some lines but not others

I have a NSTextView subclass. It displays normal text (which should wrap, ideally around the 80-char line) and ascii style tables (which should not be wrapped).
Mockup:
As you see the text on top is wrapped, while the table extends.
I have code that figures out if a line is a table, but I need some ideas on how to go with the selective (non)wrapping.
Use multiple text containers with your layout manager.
"This one is the width of the text view (it wraps); the next one is as wide as it needs to be (doesn't wrap); etc."

Resources