Notepad++ replacing '!='
-
Hi there,
since I don’t know exactly when, Notepad++ (currently installed: 8.8.1) is replacing ‘!=’ with the “not equal” (unicode) symbol.
Does anyone know how to prevent this?
Thank you very much!
Michael -
Okay, answering your own post is kind of silly but the solution is to set the rendering mode to gdi…and restarting (!)
-
When Notepad++ started enabling DirectWrite by default a few versions ago (v8.6, in Nov 2023, though it was accidentally not mentioned in the v8.6 Change list), that would have enabled any fonts that have “ligatures” available to actually use those ligatures. (The Fira Code font page describes what “ligatures” are, and what benefit they give)
But that change was more than a year ago… so either you were slow to upgrade, or you previously had an older version that got upgraded without changing your setting (if you originally had DirectWrite off, and upgraded to a version that had it on by default, it would not generally overwrite your previously-saved setting).
So you have two options to not have ligatures:
- either choose a weaker font that doesn’t have ligatures: so not “Fira Code”; maybe something like “Deja Vu Sans Mono”, which was my old favorite before I learned about “Fira Code”, and does not have ligatures. You can also search the forum for other discussions about “ligatures”, as some of those posts list fonts that either do or don’t support ligatures.
Addenda: some of the font families that come in yes-ligature and no-ligature variants: Fira Code (has ligatures) vs Fira Mono (no ligatures); Cascadia Code (yes) vs Cascadia Mono (no). Other common coding fonts only come in one variant or the other: Deja Vu Sans Mono (no); JetBrains Mono (yes). - or [as you posted while I was typing this reply], change rendering mode to
GDI (most compatible)
instead of one of the DirectWrite modes.- this has the side-effect that it will mean it is more likely you won’t be able to see emoji or maybe some non-western scripts in your text files; if you are editing files with emoji or that come from Asia, this might be too much of a negative; if not, it’s a reasonable choice
- either choose a weaker font that doesn’t have ligatures: so not “Fira Code”; maybe something like “Deja Vu Sans Mono”, which was my old favorite before I learned about “Fira Code”, and does not have ligatures. You can also search the forum for other discussions about “ligatures”, as some of those posts list fonts that either do or don’t support ligatures.