4 ms·
I suppose there are many examples like this. Once I've copied a piece of code from SO but IntellijIDEA was warning me that the semicolon at the end of the line
by iamcreasy 5y ago
I suppose there are many examples like this. Once I've copied a piece of code from SO but IntellijIDEA was warning me that the semicolon at the end of the line is not correct.
Upon further investigation(I think IntelljIDEA reported Unicode value) I've found out that the 'semicolon' I copied is a Greek character that looks exactly like semicolon.
I wonder how people on vim/emacs deal with situation like this.
- maattdd 5y agoOn VSCode, I use the Gremlins extension which highlight all those suspicious characters. https://github.com/nhoizey/vscode-gremlins https://github.com/nhoizey/vscode-gremlins
- ipmonkey 5y agovim user here. Most of us are running the same linters and language servers as every other major editor, which does a pretty good job catching stuff like this. Modern vim is really only a C core with a web of JS, Python, Lua, and vimscript using the exact same third party solutions for every other part of an "IDE". emacs is probably similar, but no personal experience with that.
- CodesInChaos 5y agoThe rust compiler warns when it encounters confusable symbols like that. Not sure about other languages.
- Cthulhu_ 5y agoIt's similar when online editors try to be clever and replace a straight " with a fancy one (like in Word), really annoying.
- Joker_vD 5y agoThat's why Powershell actually recognizes those fancy quotes and treats those as normal quotes.
- aweiland 5y agoSo one Microsoft product contains an automatic workaround for an issue created by another Microsoft product.
- Traubenfuchs 5y agoI believe they prefer to be called „smart quotes“, honey.
- effdee 5y agoPressing ga in command mode in Vim displays the ASCII / Unicode value of the character under the cursor.
- iamcreasy 5y agoYes, but IntelljIDEA's Linter showed me the error. Without linter you'll need compiler/interpreter to tell you something is not right. And in my case, even if compiler / interpreter reported about an invalid syntax - I would not think of checking the unicode codepoint as it the character appeared to look exactly like semicolon.