[Python] Forward slash ```/``` and the backslash ```\``` following a quote disappear when...

Discussão em 'Python' iniciado por Stack, Março 18, 2025.

  1. Stack

    Stack Membro Participativo

    Sublime Text / Python editor: When I type the third character after a slash character that follows and opening quotation mark (double "/... or single '/... OR "\... '\...) the slash disappears. How can I stop this behavior?

    This: "/hom turns into this: "hom.
    This: "\hom turns into this: "hom.

    So far, the only thing that seems to help is if I (in Python.sublime-settings) turn off the automatic pairing of quotes and brackets by setting auto_match_enabled to false. This causes other issues, so I would like to find a more workable solution.

    // Controls auto pairing of quotes, brackets etc
    "auto_match_enabled": false,


    For some reason, I am not able figure out how to change this behavior. I have spend hours on this, I have tried changing everything I can think of (punctuation, auto_corrects, triggers, and other stuff) so that could cause this behavior with no luck.

    This behavior only occurs only with Python editor when editing .py files in Sublime Text, and only when I type in the third character following the slash that follows the quotation mark. It is the same behavior with raw strings: r"/hom... turn into r"hom when I type in the third character after the forward slash. CTRL+Z has no effect on bringing the forward slash back after it disappears.

    Excluding the undesirable option of making the auto_match_enabled to false, the only other thing I can do is have to (1) remember that this happens, AND (2) I have to go back to the beginning of the string that I am trying to type and manually add the forward slash. NOTE: When I do go back to insert the slash character at the beginning of the sting in quotes, the slash does not disappear. I can also paste a string starting with a forward slash, and it will not disappear. This happens only when I type in the third character following the slash that follows the opening quotation mark.

    How can I type a quoted string when the string starts with a slash? What am I missing? Thank you for your help in advance.

    Continue reading...

Compartilhe esta Página