How can I disable the behaviour whereby when I type a single or double quote; a second quote is automatically appended after the text cursor?
For example if I type a single ", Dreamweaver will put "" with my flashing text cursor in the middle, as if I'm going to write "inside quotes" when really I just want one quote by itself " like this.
OS: macOS 10.14.2 (Mojave)
Dreamweaver: CC 19.00 (11193 Build)
Copy link to clipboard
It's under Edit > Preferences > Code Hints
Uncheck Auto-insert Quotes
Thanks Jon, not sure how I missed that when going through preferences.
The single quote insertion algorithm is not very sophisticated. It doesn't take into consideration the line content.
The use case for creating a new line of code has been implemented, however dealing with existing content is non-existent.
A simple heuristic to count preceding quotes could actually give a better success rate. If you have an odd number of quotes you could insert just one, if there are already an even number, insert the autocompleted quote pair. If you have access to parser you might have better success.
This is a case where a developer needed feature actually stands in the way of productivty.
This topic is 4 years old. See below for details on Code Linting in Dreamweaver.
I already have Lint enabled and keep an eye on the output tab for errors.
The issue with quoting not working reliably for developers is therefore more than 4 years old.
The user experience question to ask is "why would developers want to turn off double quoting - it's a useful feature, right?"
The reason is that the feature as implemented naively puts in two single quotes all the time. If you are correcting existing code, and for what ever reason you only have a single quote, as soon as you go to type just one quote auto quotes puts in two single quotes - when you only needed one.
The context that reminded me of this frustration is editing html within a php file. You use a lot of echo statements where you embed php variables within html through concatenation.
A common scenario might be that you initially copied in an actual file name and eventually you'll want to replace it with a filename that is generated from a variable.
You might start of with something like this - perhaps copied directly from an existing prototype where image.jpg is a placeholder.
echo '<img src="image.jpg"/>';
To edit this you have to split the line up to make 'stings'.' joined'.' with' single quotes and dots.
echo '<img src="'.$imageName.'.jpg"/>';
If auto quotes is enabled, every time you want to insert just one single quote, you have two single quotes inserted.
The task becomes a battle with the editor to remove each double insertion.
To start correcting this you first click, say to the right of the first double quote. Tap one single quote on the keyboard you end up with:
echo '<img src="''image.jpg"/>';
In this editing workflow, it is not your intention to type a new fully single quoted string. Since there is already a single quote preceding, I am effectively closing an existing string to the left. In php if I type a dot / period, I'm likely concatenating.
So after you have edited the left side of the image name, you now need to work on the other side.
echo '<img src="'.$image.jpg"/>';
You need to add a concenate operator and then have a closing single quoted string on the right.
With auto quotes you initially end up with
echo '<img src="'.$imageName.''jpg"/>';
However, there was already a closing single quote to the right, so just inserting one quote would close the string. There isn't a need for two.
But if you are typing new code and type a single quote, you actually do want the current automatical behaviour.
Having migrated a pure html file into php, it becomes tedious to have to delete the second single quote. Hence turning it off.
Hopefully this example illustrates why the feature might be considered an incomplete feature for the developer audience.
I don't use auto quotes. I prefer to code quotes manually in JS and PHP.
Besides, Dreamweaver is only minimally maintained now. You might be happier with PHP Storm, Rapid PHP, Code Lobster or Visual Studio Code. The latter two are freeware.
Disappointing to hear that it only is "only minimally maintained now". My annual fee doesn't reflect that.
In part, came over to Creative Cloud to manage Muse projects. Then with it its demise started moving them to Dreamweaver. (Not just for web dev, PS, LRC and Illustrator are regulars).
Thanks for the suggestions ... updating my Visual Studio now.