Removing 'prettify' / 'collapsing characters' in PhpStorm - formatting

How do I stop PhpStorm from collapsing my characters, as can be seen here:
As can be seen, then the comment-arrows are 'nice and beautiful' (bwwadr!!).
I've read through the entire preferences-sections and Google for about 30-45 minutes. ... But everything about 'collapsing' shows results about 'folding code' or 'collapsing code'. And every time I Googled anything about 'removing space between characters', then I find pages about controlling tabs'n'spaces.
This is driving me up the wall...

It called font ligatures (the only thing I'm aware of that will do such thing) -- you must have it enabled.
Settings/Preferences | Editor | Font --> Enable font ligatures
A bit info on what that is:
https://blog.jetbrains.com/webstorm/2016/06/webstorm-2016-2-eap-162-646/
https://blog.jetbrains.com/idea/2016/07/intellij-idea-2016-2-is-here/
https://youtu.be/Bjq-A4LCU9M?t=23m37s

Related

How to stop intellij-idea from removing white spaces at end of text lines in my file?

I am using 2018.1.5 community edition of intellij editor to edit a plain text file.
I am not using a project. I start it, on Linux as follows:
idea.sh my_file.mpl
where my_file.mpl is plain text file.
And this works well, except for one big problem.
I need to have an empty space at end of some lines. i.e. after the line character on some line in the file, I insert some white. I see the space is there, by doing View->Active editor->Show White spaces. I can see the small tiny dotts, showing there are white space character at end of line.
But as soon as I save the file, these white spaces are removed from end of line.
This causes a problem for me (for other reason, when this file is read by another app).
Is there an option to tell it intellij NOT to remove white spaces after the last character on the line?
Go to File->Settings->Editor->General and under Other, set the drop down next to Strip trailing spaces on Save to whatever you wish. For future reference, you can press Ctrl-Shift-A and type a search term to find any menu command or setting very quickly. In this case, "trailing spaces" or "strip trailing spaces" works really well.
Newer PyCharm (2020 and beyond) have slightly different answer than Code-Apprentice's.
Go to File->Settings->Editor->General, and then scroll down to Save Files section. The drop down Strip trailing spaces on Save for: is there. You can select None if you don't want any stripping in no circumstances.
Here is an image showing the setting:
If changing the settings in "Editor > General > Save Files" doesn't work, the below might be useful...
There is a discussion here about a possible bug (or at least confusing scenario) where you have set "Strip trailing spaces on Save for"=None and you still get stripping of trailing spaces, as I did. The comment by Oksana Chumak worked for me - namely, I unticked "Enable EditorConfig Support" in Settings > Editor > Code Style. This seems to allow a config file ".editorconfig" to be used which overrides some settings - also see Andriy Bazanov's answer, quoted below...
NOTE: If you have .editorconfig file in your project, such option can
also be controlled via that file. This file can provide more granular
control over what files are affected by those settings.
Settings from .editorconfig file will OVERWRITE IDE settings (the
whole nature of such files), so if you have such files in your project
and such instruction there, you will have to either disable the
EditorConfig for this project or disable plugin completely (if you do
not care about it at all).
I had my .editorconfig and I have used trim_trailing_whitespace=true. So that was the issue. This is what I did to fix the issue.
[*.md]
trim_trailing_whitespace=false
So here's what worked for me. I wanted intellij to keep trimming whitespaces but to keep the whitespace on blank lines.
First like #Michael-Veksler suggested, I changed intellij's default removal on save.
But it kept trimming the trailing whitespace, that was because in my .editorconfig file I had a trim_trailing_whitespace config turned on. So now I've set trim_trailing_whitespace = false.
Lastly, because I still wanted the editor to trim the trailing whitespaces, just not on blank lines I've added to my .eslintrc.js file the following setting:
module.exports = {
...
rules: {
...
'no-trailing-spaces': [2, { "skipBlankLines": true }]
}
}
And now lint-fix on save just takes care of it

How do I change the way syntax warnings for a missing semi-colon (red squiggly lines) are generated?

I love the fact that IntelliJ evaluates my code for syntax errors, but I don't like that it shows common errors on the current line as I'm typing.
There are several examples of this, but the most common one is the red error line (squiggly underline) for a missing semi-colon. I don't want the editor to check for this error until after I've finished typing the line and have pressed return. In fact, I really don't want the editor to evaluate the current line for ANY syntax errors until after I've completed it. The constant changing of the error indicators on the current line as I type is getting annoying.
I've looked around in the various options, but I can't seem to even find the name of squiggle line feature. It isn't code analysis, as that applies to the red and yellow indicators in the right margin. What is the name of this feature, and where can I find the options for it?
Example ( '|' is the current carrot position, '~~' are the red error lines)
System.Out = |
~~
The issue isn't limited to just the semi-colon, but for all sorts of other common syntax issues that I know I know about and will fix before moving on to the next line.
Update: I think the name of the feature is "error highlighting". But I still can't find any way to disable it for the current line. The closest I found was Setting --> Editor --> General --> Error Highlighting --> Reparse Delay, but that changed it globally with no option for just the current line.
There is no option in IntelliJ IDEA to disable error highlighting for the current line.
You can change the Settings -> Editor -> General -> Error Highlighting -> Auto reparse delay (ms) to something more comfortable, e.g. 3000 ms.
It will still highlight the error, but not immediately.

80-characters / right margin line in Sublime Text 3

You can have 80-characters / right margin line in Netbeans, Text Mate and probably many, many more other IDEs. Is it possible to have it in Sublime Text 3 as well? Any option, plugin etc.?
Yes, it is possible in Sublime Text 2, ST3, and ST4 (which you should really upgrade to if you haven't already). Select View → Ruler → 80 (there are several other options there as well). If you like to actually wrap your text at 80 columns, select View → Word Wrap Column → 80. Make sure that View → Word Wrap is selected.
To make your selections permanent (the default for all opened files or views), open Preferences → Settings and use any of the following rules in the right-side pane:
{
// set vertical rulers in specified columns.
// Use "rulers": [80] for just one ruler
// default value is []
"rulers": [80, 100, 120],
// turn on word wrap for source and text
// default value is "auto", which means off for source and on for text
"word_wrap": true,
// set word wrapping at this column
// default value is 0, meaning wrapping occurs at window width
"wrap_width": 80
}
These settings can also be used in a .sublime-project file to set defaults on a per-project basis, or in a syntax-specific .sublime-settings file if you only want them to apply to files written in a certain language (Python.sublime-settings vs. JavaScript.sublime-settings, for example). Access these settings files by opening a file with the desired syntax, then selecting Preferences → Settings—Syntax Specific.
As always, if you have multiple entries in your settings file, separate them with commas , except for after the last one. The entire content should be enclosed in curly braces { }. Basically, make sure it's valid JSON.
If you'd like a key combo to automatically set the ruler at 80 for a particular view/file, or you are interested in learning how to set the value without using the mouse, please see my answer here.
Finally, as mentioned in another answer, you really should be using a monospace font in order for your code to line up correctly. Other types of fonts have variable-width letters, which means one 80-character line may not appear to be the same length as another 80-character line with different content, and your indentations will look all messed up. Sublime has monospace fonts set by default, but you can of course choose any one you want. Personally, I really like Liberation Mono. It has glyphs to support many different languages and Unicode characters, looks good at a variety of different sizes, and (most importantly for a programming font) clearly differentiates between 0 and O (digit zero and capital letter oh) and 1 and l (digit one and lowercase letter ell), which not all monospace fonts do, unfortunately. Version 2.0 and later of the font are licensed under the open-source SIL Open Font License 1.1 (here is the FAQ).
For this to work, your font also needs to be set to monospace.
If you think about it, lines can't otherwise line up perfectly perfectly.
This answer is detailed at sublime text forum:
http://www.sublimetext.com/forum/viewtopic.php?f=3&p=42052
This answer has links for choosing an appropriate font for your OS,
and gives an answer to an edge case of fonts not lining up.
Another website that lists great monospaced free fonts for programmers.
http://hivelogic.com/articles/top-10-programming-fonts
On stackoverflow, see:
Michael Ruth's answer here:
How to make ruler always be shown in Sublime text 2?
MattDMo's answer here:
What is the default font of Sublime Text?
I have rulers set at the following:
30
50 (git commit message titles should be limited to 50 characters)
72 (git commit message details should be limited to 72 characters)
80 (Windows Command Console Window maxes out at 80 character width)
Other viewing environments that benefit from shorter lines:
github: there is no word wrap when viewing a file online
So, I try to keep .js .md and other files at 70-80 characters.
Windows Console: 80 characters.

How do I display brackets around assumptions in Isabelle/jEdit?

When goals are displayed by Isabelle in ProofGeneral, assumptions are rendered as having brackets around them as so:
In Isabelle/jEdit, however, this seems to have changed to meta-implication arrows:
While I understand the former is somewhat non-standard, I find it much easier to read. Is there a way to modify the behaviour of Isabelle/jEdit to print out goals in the old ProofGeneral style?
The format Isabelle renders its output is determined by Isabelle's "print modes". In ProofGeneral, the default print_mode includes the brackets mode, which renders brackets around assumptions, while the default jEdit print_mode includes no_brackets, which does the opposite.
The print mode can be changed either by setting Plugins > Plugin Options > Isabelle/General > Print Mode to brackets and restarting jEdit, by adding -m brackets to the isabelle jedit command line, or by including in your ~/.isabelle/etc/settings file:
ISABELLE_JEDIT_OPTIONS="-m brackets"
This will result in jEdit displaying brackets like ProofGeneral:
Go into Plugins -> Plugin Options -> Isabelle -> General
then type in brackets in the Print Mode field.
Click Apply.
Then close out of Isabelle and restart it.
You should have brackets around your hypotheses thereafter.

IE 10 not rendering Japanese correctly

I recently discovered an issue with IE10. We have a web page that displays English text beside a translation in Japanese. Some of the Japanese characters display as squares. In the view source page all characters are correctly rendered. The database also has the characters correctly rendered. The unusual part is that when I block the characters with the cursor they convert to the correct characters.
IE10 I believe has a bug.
Anyone having similar issue or know of a fix? Checked all language settings, regional settings, browser font settings and many other tests. Nothing corrects this issue.
This issue was related to a dual byte character which some fonts and windows applications will support.
Some older fonts may use a two hex character representation to present a single character. Some fonts support this and some do not.
In this case the characters at issue were the following…..
ジ
シ and ゙
The latter two which I think are special characters that combined are intended to represent ジ.
The Unicode Standard from the Unicode ISO web site table defines them like so…..
Decimal Character HEX Name
12472 ジ 30B8 KATAKANA LETTER ZI
12471 シ 30B7 KATAKANA LETTER SI
12441 っ゙ 3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK (combined with small tu (っ))
So some fonts use 12471 + 12441 to make 12472. This is what I found. But the actual string has 12471 + 12441 and not 12472 or the hex: 0x30B7, 0x3099 and not 0x30B8.
Any time a font being used does not support this binding, a box is displayed. The challenge is that it may be as simple as someone creating a birthday card using a non-compliant UTF8 font that could cause a PC to not allow the character to display correctly.