fileability/chocolat-public — Issue #787: Bug: Blows up when backspacing a new string interpolation in erb!
Author: MeetDom
Created: 2012-02-29 08:43:19+00:00
State: open

This has been happening since day dot and I'm surprised no-one has come across it or reported it. If it has been reported I apologize, I couldn't find it.

When editing ruby code inside a string, if I type #, Chocolat rightly assumes I want to add some interpolation. It adds the hash and opening and closing curly braces, eg. `#{}`. It then places the cursor at the end, behind the closing brace. If you then hit the backspace key, Chocolat blows up spectacularly losing all changes.

I do this all the time and then smack my head repeatedly on the desk, knowing full well that this is going to happen! I mean how stupid am I? Every time I do this I could just kick my own but if it were possible. Can you please *urgently* fix this behavior and save my forehead from any further damage?

Ideally, if Chocolat is going to assume I want to add some interpolation, it would be great if it repositioned the cursor inside the braces, and of course didn't blow up if I did hit the backspace key, as this is most undesirable also.