How to stop quotation mark autocorrect ripple effect

I'm editing some old code, which often has both single-quoted and double-quoted strings. I know PHPStorm has the urge to help, but it's screwing up code I'm not even touching. Below is an example - the changed line at the top of this diff screenshot is the only thing I actually changed - first I chopped out the middle part, and then I changed the opening single quote to a double quote. But PHPStorm responded by messing up a quote several lines later! And of course it also thinks the code after that has problems, all because of a quote mark it changed without my permission. [By the way, please don't lecture me about separating presentation from business logic - yes, I know everything is mixed together old-style. I still need PHPStorm to help, not harm.]

I looked through the Settings for something about auto-correcting quotation marks, but didn't find anything. What "feature" should I disable to solve this? I like the fact that it shades code when quotes are mismatched, but it shouldn't try to guess what I intend to be the end of a string and make changes on its own.

1

Go to Settings (Preferences on macOS) | Editor | General | Smart Keys and uncheck the "Insert pair quote" checkbox. This is the only thing that comes to my mind that could do this.

1

I had the same problem. It seems the "Insert pair quote" is the culprit (but the setting name does not really match the feature: after I unchecked the setting, PS stops replacing quotes to "match" them, but it still inserts a pair of quotes (which is good!))

0

请先登录再写评论。