dracula / visual-studio-code

🧛🏻‍♂️ Dark theme for Visual Studio Code
https://draculatheme.com/visual-studio-code
MIT License
777 stars 208 forks source link

[Bug] Selection after snippet isn't working correctly #190

Closed igonro closed 2 months ago

igonro commented 3 years ago

I found this bug using the following Python snippet:

"if(main)": {
    "prefix": "__main__",
    "body": [
        "if __name__ == \"__main__\":",
        "    ${1:pass}"
    ],
    "description": "Code snippet for a `if __name__ == \"__main__\": ...` block"
},

I've tested it out and this also happens for other languages snippets.

Current behaviour: image

Expected behaviour: image

Other themes:

brannonh commented 3 years ago

I just checked this in my VS Code setup, and I don't have this problem. Do you have anything in your settings JSON that might be contributing to this behavior? For example I've added settings in workbench.colorCustomizations that (purposely) accomplishes something similar to what's in your screenshot.

Nikki942 commented 3 years ago

Hello there! You can follow these steps to get the expected behavior:

  1. Go to Settings-->Workbench-->color customizations.
  2. Edit in settings.json If you find this line (you may have a different color ) "editor.selectionHighlightBorder": "#4210b6", in "workbench.colorCustomizations", you can remove it.

"workbench.colorCustomizations": {

    "editor.selectionHighlightBorder": "#4210b6",[remove this line]

}

Please let me know if it helps:)

igonro commented 3 years ago

My settings.json is like this, I don't know what could be wrong...

{
  // Appeareance configuration
  "workbench.colorTheme": "Dracula",
  "workbench.iconTheme": "material-icon-theme",
  "editor.fontFamily": "Cascadia Code",
  "editor.fontLigatures": true,
  "editor.fontSize": 15,
  "editor.fontWeight": "normal",
  "terminal.integrated.fontSize": 15,
  "terminal.integrated.fontWeight": "350",
  "editor.cursorBlinking": "phase",
  "terminal.integrated.cursorBlinking": true,
  "editor.rulers": [120],
  "editor.minimap.enabled": false,
  "editor.mouseWheelScrollSensitivity": 1.5,
  "editor.smoothScrolling": true,
  "editor.fastScrollSensitivity": 3,
  "workbench.colorCustomizations": {
    "[Dracula]": {
      "editor.selectionBackground": "#bd93f980",
      "editor.selectionHighlightBackground": "#59595e88"
    }
  },

  // Formatting configuration
  "editor.tabSize": 4,
  "editor.formatOnSave": true,
  "prettier.printWidth": 120,
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[python]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  },

  // Git configuration
  "git.autofetch": true,
  "git.autofetchPeriod": 180,
  "git.autorefresh": true,
  "git.autoStash": true,
  "git.pruneOnFetch": true,
  "git.showPushSuccessNotification": true,

  // Python configuration
  "python.languageServer": "Pylance",
  "python.analysis.typeCheckingMode": "off",
  "python.formatting.provider": "black",
  "python.formatting.blackArgs": ["--line-length=120"],
  "python.linting.enabled": true,
  "python.linting.flake8Enabled": true,
  "python.linting.flake8Args": [
    "--max-line-length=120",
    "--max-complexity=18",
    "--docstring-convention=google",
    "--ignore=D1,W503,W504"
  ],

  // Intellicode configuration
  "editor.suggestSelection": "first",
  "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",

  // New configuration (below window setting)
  "workbench.startupEditor": "welcomePage",
  "window.newWindowDimensions": "default"
}
igonro commented 3 years ago

@brannonh I tried removing the colorCustomizations that I have, but the behavious remains the same... @Nikki942 I don't have any editor.selectionHighlightBorder option

Thanks both for the help. Let see if someone finds out the error...