tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

Messages Clobber C-S #47

Closed mbriggs closed 12 years ago

mbriggs commented 12 years ago

This may just be because im a noob and don't know what I'm doing, but messages like "Undeclared Variable" (which show up pretty much all the time if you are using 3rd party libraries and referencing globals from them) tend to clobber c-s in the minibuffer, meaning that i can search for things, but the message will flicker every time i add or remove a char. Note that this doesn't seem to bother find-file or m-x or anything else really

tamzinblake commented 12 years ago

@mbriggs I hadn't noticed that behavior before - it also happens with other messages. I'll look into it.

By the way, if you're referencing globals foo and bar from another file, you can add the line:

/* global foo bar */

As the first line of your js file, and js3-mode will recognize them as declared. This is the same syntax JSLint uses.

mbriggs commented 12 years ago

Awesome :D

mbriggs commented 12 years ago

just want to say that after a day of using it, I totally love /* global */. It gives a nice documentation of globals being used in that file, and if that line gets too long, its a great code smell indicating the stuff in that file is probably doing too much.

jmarca commented 12 years ago

Can you add this /* global ... */ syntax to the wiki docs? It is super handy, but I keep forgetting it and have to either grep or find this page...

tamzinblake commented 12 years ago

@jmarca Sure thing: Features