最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

autocorrect - Forward slash `````` and the backslash `````` following a quote disappear when typing the third following chacter

programmeradmin0浏览0评论

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?

When typing:
"/hom turns into this: "hom.
"\hom turns into this: "hom.
Unicode codepoint "\u002F turns into "u002F
Newline \n after the double quote "\n555 turns into "n555

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.

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?

When typing:
"/hom turns into this: "hom.
"\hom turns into this: "hom.
Unicode codepoint "\u002F turns into "u002F
Newline \n after the double quote "\n555 turns into "n555

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.

Share Improve this question edited Mar 19 at 18:51 rich neadle asked Mar 19 at 0:01 rich neadlerich neadle 8042 silver badges8 bronze badges 3
  • I could not reproduce it on recent SublimeText4. But what version are you using? The tag says [sublimetext3], is it correct? – VPfB Commented Mar 19 at 7:51
  • 2 Try subl --safe-mode. If it helps, some setting or some plugin is probably to blame. Or you might have discovered a bug. However, last release of SL3 is dated 2019. I guess they maintain only the SL4. Probably its time to upgrade. – VPfB Commented Mar 19 at 11:55
  • ISSUE FIXED!! Thank you, @VPfB ! (NOTE: I actually do have Sublime Text 4). I went to the safe mode, and everything worked. Installed Python package everything worked. Then, I went back to regular mode and I started deleting packages one by one. It was an older package called "AutoFileName" that has been causing all this headache with the auto-correct. Thank you so much for your tip! : D – rich neadle Commented Mar 19 at 19:37
Add a comment  | 

1 Answer 1

Reset to default 1

RESOLVED

PROBLEM: When in Python Editor, only when typing, any slash (/ and \) placed after an opening quotation mark ((' or ") disappeared when typing the third letter after the slash.

ISSUE: sublime-package called AutoFileName.

SOLUTION: Remove AutoFileName package in Sublime Text 4.

TROUBLE SHOOTING SUBLIME TEXT EDITOR FOR THIS AUTOCORRECT ONLY IN PYTHON ISSUE:
After (optionally) checking the Preferences/Settings for any obvious auto_correct issues (do not spend 3+ hours like me), move to test the Sublime Text app settings before any settings changes or packages were installed in the SAFE MODE allowing you trouble shoot from ground up.

  • Make sure your Sublime Text app updates are up to date: In Sublime Text app go to Help/Check for updates...
  • Get a list installed packages for reference in trouble shooting: In the Sublime Text app go to Preferences/Browse Packages. This will open a folder on your computer for ../Sublime Text/Packages. From the ..Sublime Text/Packages navigate back to Sublime Text folder and then go to Sublime Text/Installed Packages folder that will list all the installed packages. I took a screenshot. This will be helpful later when I start deleting packages troubleshoot, I know the package names I have, so I can reinstall them easily.
  • Close all instances of your Sublime Text app to move to safe mode: (https://www.sublimetext/docs/safe_mode.html) (Windows: Open Sublime Text while holding keys SHIFT+ALT (for Windows)(Mac: Hold Option key)
  • In safe mode:
  • Create .py file. Test for problem by typing "\hello. - > Works correctly. This means that the issue is not with the basic set up of the Sublime Text app.
  • Install Package Manager: In Sublime Text, CRTL+SHIFT+P. In the search bar that opens on the top, type install... to search. From dropdown menu select Install Package Control.
  • Install any packages you have at the ../Sublime Text/Installed Packages folder, to see if you are able to recreate the problem.
  • You can install a package in the Sublime App with package control: Open Package Control search bar with CRTL+SHIFT+P. In the search bar, type install. Select Package Control: Install Package. In the search bar, type the name of the package you want to install. Select the package from the list below. And, the package is installed.
  • After installing any package, in your .py file, try to recreate the problem. In my case, I was not able to recreate the problem after installing some of the packages on my list. This tells me that the package(s) that I thought were the problem, were not the problem.
  • Normal mode:
  • In parallel to the safe mode, open the Sublime Text app normally. I started removing and and reinstalling packages with CRTL+SHIFT+P (or Preference/Package Control). In the search bar, type install. Select Package Control: Remove Package or Package Control: Install Package respectively.
  • After removing a package, I do another typing test in the .py test file to try to recreate the issue. If the issue persisted after removing the package, I would reinstall the package.
  • I kept removing and reinstalling packages, until I came to and older (archived 2022) package called AutoFileName. Once I removed this package, the issue with typing in my .py file typing issue was resolved.
发布评论

评论列表(0)

  1. 暂无评论