Any key opens a web inspector


#1

I just got Atom beta invite and am itching to start. But I see a really weird behavior and cannot understand if it’s a bug or I’m simply doing it wrong.

  1. Start Atom editor.
  2. In an empty tab, press Cmd+S, name the file /tmp/my.cpp.

And now the editor gets into some funny mode wherein any key press opens a Web Inspector.

Editor seems to work ok if I don’t save it first - until I manually set language to C++ by clicking “Plain text” in the bottom.


Cant type in language C
#2

I’ve seen this happen too (not working with C++) but I don’t know how to reproduce.


#3

I’d guess an unhandled exception, perhaps from a buggy plugin. Next time it happens open the console part of the web inspector and see if there’s a backtrace.


#4

This happens for me with the language set to C++/Objective-C++, strangely only on the first line. Stack trace: http://i.imgur.com/QeNhE52.png


#5

This is the error I get:

Uncaught TypeError: Cannot read property 'c' of undefined /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:99

#6

That’s the one I see as well.


#7

Yep. Same here. Happens with certain key combinations in both C and C++ (.c, .cpp, .h) files.

Super easy way to reproduce this:

  1. Open a new file
  2. Change the language to C++
  3. Type a forward slash /

For reference, Atom 0.80.0.


#8

Plus one, I’ve seen it as well a couple of times.


#9

Keep an eye on the GitHub issue for this.


#10

The problem I think is that github is using slick to parse scopes (see scoped-property-store.js line 93), and slick gets confused by the ++s in the C++ scopes, of example:

slick.parse("scope.c++")
{ '0': 
   { '0': 
      { combinator: ' ',
        tag: 'scope',
        classes: [Object],
        classList: [Object] },
     '1': { combinator: '++', tag: '*' },
     length: 2 },
  length: 1 }

notice the ‘combinator’ business.

I don’t know if the preferred fix is to change the grammar, or the parser. For now to regain a working atom.io, you could go into /Applications/Atom.app/Contents/Resources/app/node_modules/language-c/grammars and run:

perl -pi -e "s/\.c\+\+/\.cxx/g;" c++.json
perl -pi -e "s/\.c\+\+/\.cxx/g;" c.json

SUPER WARNING: Obviously editing config files inside the executable is something that should be done with care, and don’t complain to me or github if you break anything!

SUPER SUPER WARNING: This will break ruby and objective-c, and there will be a patch to the central parsing engine which removes the need to do this.


#11

0.81.0 was just published with this fix in there, it should roll out via the auto-updater over the next hour.

According to @kevinsawicki. Thanks for the quick fix!


#12

I just had this problem with Atom 0.81.0, editing a JavaScript File, when fixing an error suggested by JSHint.

I can’t seem to be able to reproduce it again, and I was not wise enough to save the backtrace before closing the window :frowning:

What I do remember is that the error was at row 1009 of
/Applications/Atom.app//Contents/Resources/app/src/editor-view.js

          isReversed: _this.editor.getLastSelection().isReversed()

and the error was that getLastSelection() returned either undefined or null.

I’m sorry, I can’t be any more precise than that.