Sublime Forum

"Unexpected Character" message every time I type text

#1

I’m unsure what this is. It’s getting really frustrating. Anyone encounter a similar thing?

28%20PM

0 Likes

#2

It looks like a third party linting/code checking package of some kind, though not one that I’ve seen previously. Core Sublime doesn’t generate notifications like that on its own.

I’m guessing you didn’t install a direct code check package of some kind on purpose or you’d know where that is coming from. Sometimes packages dedicated to a specific aspect of a language also include code checkers. So, you might want to run through the packages you installed to see if that’s the case.

0 Likes

#3

In my case, the package that was showing those annoying errors was Babel.

I was getting “Unexpected character” errors with perfectly valid code.

Edit:

Hmmm no. The error has returned.

After investigating further, it seems Emmet is the culprit.

1 Like

#4

It is because of Emmet.
I installed BOOTSTRAP 3 SNIPPETS, package, whenever I used them, this thing came again and again. So I just disabled all packages line by line, and then, when I disabled Emmet, it gone. And emmet is very important for web development, so I am trying to do anything by which emmet is also there, and the snippet can also be used.
THANKS FOR YOUR TIME.

0 Likes

#5

You can disable it by disabling the abbreviation_preview from here.

4 Likes

#6

Yes, I agree with you. Setting "abbreviation_preview": false hides the error message.

Unfortunately, it doesn’t prevent Emmet from capturing the abbreviation. If you press php+tab, the expanded code is underlined (see left image). This means, it is still captured by Emmet. If you want to get rid of the underlining (leave the capturing), you have to press the escape key. See right image.

I don’t want to press the escape key every time. Does anyone know a way to disable Emmet completely when php+tab (or any other PHP snippet) is pressed?

I still want to use Emmet abbreviations for HTML code in PHP files. So I don’t want to use one of the following settings:

  • "auto_mark": false
  • "auto_mark": "stylesheet"

1 Like