smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Request: Change behaviour of deletion in escaped strings

Open elemakil opened this issue 11 years ago • 1 comments

I'd like to suggest a change in the behaviour of the deletion commands bound to <backspace> and <delete> if the user is operating on an empty, escaped string. Consider this [point is symbolised by |]: "\"|\""

If the user were to move one char forward and hit <backspace>, the result will be ""\""

I'd suggest that deleting the escape char (the backslash) of an escaped string un-escapes the string, hence the result would be """"

I'm suggesting this behaviour for the case of an empty string only, however, one could also expand upon this and allow to un-escape a non-empty string using the method: "foo bar \|"bloing baz\" FooBar"

hiting <backspace> yields "foo bar |"bloing baz" FooBar"

Similarly, I'd like to request that calling <delete> on "\"|\""

will un-escape the string, i.e. yield """"

I think that the suggested behaviour is much more sane and intuitive than the current behaviour.

elemakil avatar Jul 16 '14 09:07 elemakil

Makes sense, however, it will probably have to wait for the 2.0 version, which might take some time (I am very slowly rewriting pretty much everything from zero because it's a huge pile of messy code right now).

Fuco1 avatar Jul 16 '14 10:07 Fuco1