Strangely, it’s not equal to (≠)
Recently, stack length with IntelliJ IDEA to see the source code found:
What the hell is this?
Java is not equal to written not all the time! =? Since when can I write ≠??
It’s not scientific
I thought I was presbyopia, so I carefully watched it for several times and thought it should be the special effect of IDEA. Then I clicked the symbol, only to find it could not be restored.
Then the Internet surfing, I finally found this switch:
Preferences > Editor > Reader Mode > Font ligatures
Reader Mode: Editor Settings for read-only Mode.
The “Font ligatures” could be made out of the stock and could scarcely contain any of the original stock. It’s not surprising that = is shown as ≠.
After canceling this switch, take a look at the source code above:
Finally back to normal, this is comfortable to look at.
Ligatures extension
Words can be put in the source code! = is displayed as ≠, so it should be displayed in a normal code editor, right?
That’s right!!!!!
In the “ligatures” menu, the stack can be bounded with the “Font ligatures” set.
Then open this option:
Preferences > Editor > Font > Enable font ligatures
Stack length write some random code to test:
Normal code editor can also display!
As you can see from the above test code, I added a >=, so not only is it not equal, but more symbols can be seen by toggled this switch.
Off switch, native display:
Turn on the switch instead of displaying:
I’ll now copy the test code again:
public class Test { public static void main(String[] args) { int n = 1; if (n ! = 0) { System.out.println(1); } if (n >= 1) { System.out.println(2); }}}Copy the code
As you can see, the code is copied in normal syntax.
conclusion
I didn’t know which version of IDEA had the default Font Ligatures switch.
This feels like an intelligent display in IDEA:
As shown above, because generic types above Java 7 can be inferred automatically, if the collection interface has generics and the collection implementation has generics, the collection implementation’s generics will be folded into a ~ display. Mouse over or click on it will show the native code, and it will also tell you that generics in the collection implementation are redundant.
But very speechless, such as not equal to the symbol but cannot click/hover display native symbols, requires a hard switch.
In short, I felt that the creature was useless and didn’t really recommend using it, so I silently disabled the Font Ligatures of the creatures otherwise it would confuse the view.
Of course, radish cabbage each has love, have what like this kind of show means that is true sweet law.
IDEA is fragrant, you may say that you need to charge for it, in fact, it also has open source community version, charging professional version is also easy to apply for activation code, pay attention to the public number Java technology stack, reply: IDEA, you can read the tutorial I shared to obtain the legitimate IDEA activation code, many fans feedback that it is easy to get, interested can go to apply, not too easy.
Finally, if this article is helpful to you, click a look at the encouragement oh! Also welcome to share and forward to more friends in need ~
What other weird ideas have you encountered? Welcome to share ~
Copyright notice: this article is the public account “Java technology stack “original, original is not easy, reprint, quote the content of this article please indicate the source, prohibit plagiarism, washing, please respect your work and intellectual property rights, plagiarism will be prosecuted.
Recent hot articles recommended:
1.1,000+ Java Interview Questions and Answers (2021)
2. I finally got the IntelliJ IDEA activation code thanks to the open source project. How sweet!
3. Ali Mock is officially open source, killing all Mock tools on the market!
4.Spring Cloud 2020.0.0 is officially released, a new and disruptive version!
5. “Java Development Manual (Songshan version)” the latest release, quick download!
Feel good, don’t forget to click on + forward oh!