Skip to content

Auto-Escape String Delimiters in String Literals #5009

Open
@retailcoder

Description

@retailcoder

Justification
SCP is currently bailing out when it determines that the caret is inside a string literal. There's an opportunity to handle double-quote escaping here - something that is still very frequently being asked about on SO.

Description
Instead of bailing out, handle " keypress inside a string literal by doubling the character and placing the caret after the escaped quotes:

MsgBox "foo|bar" ~> MsgBox "foo""|bar"

One consideration is the closing character - SCP behavior needs to remain consistent, so if the caret is just before the string-closing quote, auto-escape should not happen (i.e. preserve current behavior):

MsgBox "foobar|" ~> MsgBox "foobar"|

Adding escaped double-quotes at the end of a string literal would need to be done by adding a temporary space, that can then be removed:

MsgBox "foobar| " ~> MsgBox "foobar"" "

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.feature-autocompletefeature-self-closing-pairsAC issues specific to the handling of self-closing pairs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions