if I sets NSCenterTextAlignment for my NSTextView
my whitespaces at the end of string magically disappears
for example I have string
#"while "
if I display it with NSRightTextAlignment it shows well
|white |
but with NSLeftTextAlignment all whitespaces just cut
|white|
how can I get results like
| white|
tabs is not an option
Just a guess: it sounds as if you are trying to left-align centered items by using spaces to pad some of them. If you must do this you can use non-breaking spaces (UTF-16 0x00A0, type as option-space). HTH
Related
I would like to print a tab space and also a hyper link in the description of a message embed.
Using \t along with three ` will print a tab space and [click](https://example.com) makes a hyper link.
However, I want to combine these to so I get <tab space> <hyperlink>
I have noticed that using 3 ` together with \t and [click](https://example.com) will print the tab space, but instead of printing the hyper link, it prints exactly like this <tabspce> [click](https://example.com)
Using a blank emoji instead of \t worked.
This is the emoji I used <:Blank:850603065760284722>
If I have an ohmyzsh theme that uses %~/ to get the current directory path. Is there a way to tell it that if the line length requires wrapping onto a new line, to use just the current directory without the full path?
Not exactly, but Zsh can actually do something better than that! You can use %-X<Y<Z%<< to ensure you always have at least X characters remaining after your prompt, by trimming the left side of Z and replacing the trimmed part with Y. (Note that Y itself is always printed literally and any prompt escape sequences inside it will not be expanded. If you want to style Y differently from Z, you will have to put the prompt escapes before and after %X<Y<.)
For example:
PS1=$'\n%-40<...<%~%<<%# '
What this does:
If expanding %~ would leave 40 or more characters of empty space on the line, then expand it in full.
Else, print a ... to the left of %~ and trim off characters from the left of %~'s expansion until our prompt leaves exactly 40 characters of empty space on the line.
Always expand %# after this (since it occurs after %<<).
The nice thing about this is that it works for the current prompt even when you resize your terminal. Just try it and you'll see it will dynamically add or remove characters as you resize.
I'm using data merge to import two variables per line, and have checked the "Remove blank lines for empty fields" box. The result is a wealth of extra characters that I can't remove using find-and-replace. Of the 24 lines of variables, typically only three contain text, so the other 21 should be empty lines and be deleted by the "Remove blank lines" option.
Attempting to paste these characters into the "find and replace" field, I see
^|^|^|^|^|^|^|^|^|^|^|^|^|^|
Any suggestions? Thanks
Try doing a regular text find/change.
In the Find What field, type < FEFF > (but delete the spaces before and after those angle brackets – the Stack Overflow editor seems to delete this if there are no spaces).
In the Change To, leave blank, and click change all.
When I'm using ShowText's whitespace (spacebar spaces) (in Block Composer), it only works in middle of the texts but not at the beginning of the text. I assumed it is because PDFClown do trim the whitespace characters.
So is there special character I can use in place of whitespace so it won't get trimmed?
Yes, leading whitespace is purposely trimmed off: if you need to indent your paragraph then use the BlockComposer.ShowBreak(SizeF) method specifying a horizontal offset (for example blockComposer.ShowBreak(new SizeF(10,0))).
I can use VIM to input these color control chars by "Ctrl-V, Esc" then it will show me ^[ as a special leading char for color control chars sequence.
How could I do this in Textmate?
Thanks
You can select those from the character viewer (Menu Edit -> Special Characters, then search for 'escape'), but I think you'd be better off using an escaped form of that character, e.g. \033 in Bash or \x1b in PHP. That, of course, would depend on what kind of document you're editing.