4 ms·
I would probably have to quit my job before I could figure out that problem. May I ask how did you spot it?
by slowmotiony 11y ago
I would probably have to quit my job before I could figure out that problem. May I ask how did you spot it?
- slig 11y agoSomething similar happen to me, but with that fancy quotes. I spotted by doing a "binary-search weird bug hunt". Cut half of the code off and see it it's still complaining, if it's, cut the other half, and so on.
- jprince 11y agoAh, that old stand-by. Always warm and ready for the odd unicode hell-bug.
- sethammons 11y agoI had a similar problem. Copied a code snippet. Ruby started complaining about an undefined function. After nearly going mad, and then looking at the source through a hex editor, you could see Unicode whitespace. I have yet to forgive ruby or Unicode whitespace. Or the chat utility from whence I copied.
- austinjp 11y agoWeird bugs can respond well to brutally dumb debugging. Open file and search for ; perhaps? Or grep etc. When you can see semi-colons but your find tool can't, that's a worry. But yeah getting to that point relies on pure inspiration, in my case.
- err4nt 11y agoI find searching, and search and replace the most useful IDE feature, you can reformat entire documents with a series of well thought out search and replaces:)
- falcolas 11y agoPersonally, my vim status line has an indicator which shows the hex code for the rune currently under the cursor. After fighting against word processor quotes, it's become second nature to double check it periodically.
- coldpie 11y agoCool! How do you do that?
- leephillips 11y agoI'd like to know, too. Until then, you can type "ga" in normal mode to get a display of the decimal, hex, and octal value of the character under the cursor.
- iamcurious 11y agoThat seems useful. Can you share it?
- falcolas 11y agoHere you go: :set statusline=%F%m%r%h%w\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] :set laststatus=2 Produces a status line when inserting and recording a macro like (the character under the cursor is 'm': ~/.vimrc [TYPE=VIM] [ASCII=109] [HEX=6D] [POS=0123,0020][67%] [LEN=182] -- INSERT --recording And, of course... `:help statusline`
- mattlondon 11y agoIt was a while ago now, but I remember copying the code out to a controlled isolated environment on my local machine, picking the first line and making sure it reproduced. After that it was a matter of just going through the usual steps of working out why something isn't working. I think in this instance I actually ended up manually retyping the code, and when getting "identical" code that worked that was when the penny dropped and I realised something was not what it seemed. If you paste suspect characters into something like http://unicode-table.com/en/ http://unicode-table.com/en/ it will tell you right away what it really is.