2

I saw some similar questions but none of them solve my problem.

Whenever I edit an HTML tag, VS Code always selects what it thinks is the matching tag and edits it along with what I am typing. This is very annoying because it often changes the incorrect tags. I want to completely disable this. I do not want anything else in the file to be modified when I am changing an HTML tag. I have diabled HTML > Format and HTML: Auto Closing Tags but it still automatically changes other tags when I want to do it manually. Is there any other setting that will completely prevent any auto changes in HTML?

Settings enter image description here

Incorrect tag being automatically selected and changed enter image description here

settings.json

{
    "telemetry.enableTelemetry": false,
    "telemetry.enableCrashReporter": false,
    "workbench.editor.enablePreview": false,
    "python.formatting.formatOnSave": false,
    "typescript.updateImportsOnFileMove.enabled": "always",
    "workbench.tree.indent": 16,
    "html.format.enable": false,
    "typescript.autoClosingTags": false,
    "javascript.autoClosingTags": false,
    "html.autoClosingTags": false
}
Stack Underflow
  • 2,363
  • 2
  • 26
  • 51

2 Answers2

1

The solution is to add the following setting: "html.mirrorCursorOnMatchingTag": false

The setting documentation

Stack Underflow
  • 2,363
  • 2
  • 26
  • 51
0

I am currently using VSCode and am not experiencing these issues, it's strange that it's still doing it even after disabling the setting.

Can you please follow these instructions and post your settings.json file? (this is the underlying file that vscode uses to define it's settings)

Settings file locations (from https://code.visualstudio.com/docs/getstarted/settings)

By default VS Code shows the Settings editor, but you can still edit the underlying settings.json file by using the Open Settings (JSON) command or by changing your default settings editor with the workbench.settings.editor setting.

Depending on your platform, the user settings file is located here:

Windows %APPDATA%\Code\User\settings.json

macOS $HOME/Library/Application Support/Code/User/settings.json

Linux $HOME/.config/Code/User/settings.json

There should be a line similar to:

    "html.autoClosingTags": true,

OR

    "html.mirrorCursorOnMatchingTag": true,

If you change this to false it may fix the problem but if you show your config file we should be able to see if there is another issue.

Community
  • 1
  • 1
rattybag
  • 381
  • 2
  • 8