Skip to content

Highlighting for SQL injections in Python are not removed when comments are removed #46104

@JosephTLyons

Description

@JosephTLyons

Reproduction steps

  1. Open a python file
  2. Type cmd = "SELECT col1, col2 FROM tbl"
  3. Add #sql above (see sql highlighting)
  4. Remove #sql, notice highlighting sticks
  5. Only way to kill the lighting is to move line up / down
Screen.Recording.2026-01-05.at.3.18.08.PM.mov

Current vs. Expected behavior

Current behavior: SQL highlighting is not removed as sql comment is removed
Expected: I expect the injected SQL highlighting to disappear as the comment is removed.

Zed version and system specs

Zed: v0.219.0+nightly.2060.93c447e874d1e6a669086c7c50c179fdef67faa0 (Zed Nightly 93c447e)
OS: macOS 26.1
Memory: 64 GiB
Architecture: aarch64

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:languages/pythonPython programming language supportfrequency:alwaysBug that happens for everyone on every platform no matter how they use Zedpriority:P2Average run-of-the-mill bugsstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions