Pistachio
Pistachio

Reputation: 1652

NO-BREAK SPACE after quick auto-complete double brace PhpStorm

In Laravel's Blade Template, the use of double braces {{ }} is used quite a lot.

I have a small issue though. PhpStorm will auto complete {{ to the full {{}}

However, as most Laravel developers adds spaces like {{ route('home') }}, I quickly type {{ then add a space.

Normall this would add unicode spaces like %20 on each side of the cursor after auto completion {{ CURSOR }}

However, if I do it too quick, it adds the %A0 (NO-BREAK-SPACE) character instead and does not add the trailing space, causing the statements inside to fail. {{ CURSOR}}

Is there a way, to either fix this permanently - or to default the auto completion of double braces to add the spaces before and after the cursor by default, like it does when typing {! (this might be a plugin)

Edit:

I figured out that my keyboard (Norwegian) has a slight issue with phpstorm perhaps. I use Alt Gr+7 to write a open brace. If I do it too quick, Alt Gr + Space produces a no-break space. I'm trying to figure out now how to either disable that keybind or some other way of ignoring it.

Edit2 It was Ubuntu, see my answer

Upvotes: 0

Views: 458

Answers (1)

Pistachio
Pistachio

Reputation: 1652

It appears this was not an issue in PhpStorm at all. It was an issue with my Norwegian keyboards, Alt Gr + Space and Ubuntu

In ubuntu Alt Gr + Space produces the non-break space character

I disabled this keybind by typing this into my terminal:

setxkbmap -option "nbsp:none"

Upvotes: 2

Related Questions