Commit log

68295ba markdown: Fix Markdown table not rendering in hover popover (#44712)

Click to expand commit body
Closes #44306

This PR makes two changes:
- Uses the new `grid_cols_min_content` API. See more here:
https://github.com/zed-industries/zed/pull/44973.
- Changes Markdown table rendering to use a single grid instead of
creating a new grid per row, so column widths stay consistent across
rows.

Release Notes:

- Fixed an issue where Markdown tables wouldn't render in the hover
popover.

Smit Barmase created

5152fd8 agent_ui: Add scroll to most recent user prompt button (#44961)

Click to expand commit body
Release Notes:

- Added a button to the agent thread view that scrolls to the most
recent prompt

Lukas Wirth created

4e48228 agent_ui: Add keybinding to cycle through profiles (#44979)

Click to expand commit body
Similar to the mode selector in external agents, it will now be possible
to use `shift-tab` to cycle through profiles.

<img width="500" height="384" alt="Screenshot 2025-12-16 at 9  04@2x"
src="https://github.com/user-attachments/assets/11e8824e-9fad-4aab-9e19-53878096db52"
/>

Release Notes:

- Added the ability to use `shift-tab` to cycle through profiles for the
built-in Zed agent.

Danilo Leal created

30deb22 agent_ui: Add the ability to delete a profile through the UI (#44977)

Click to expand commit body
It was only possible to delete profiles through the `settings.json`, but
now you can do it through the UI:

<img width="500" height="1954" alt="Screenshot 2025-12-16 at 8  42@2x"
src="https://github.com/user-attachments/assets/077ecdf5-1e80-4b70-86c9-177cc3741e77"
/>

Release Notes:

- agent: Added the ability to delete a profile through the "Manage
Profiles" modal.

Danilo Leal created

f358b95 gpui: Add grid repeat min content API (#44973)

Click to expand commit body
Required for https://github.com/zed-industries/zed/pull/44712

We started using `grid` for Markdown tables instead of flex. This
resulted in tables having a width of 0 inside popovers, since popovers
are laid out using `AvailableSpace::MinContent`.

One way to fix this is to lay out popovers using `MaxContent` instead.
But that would affect all Markdown rendered in popovers and could change
how popovers look, or regress things.

The other option is to fix it where the problem actually is:
`repeat(count, vec![minmax(length(0.0), fr(1.0))])`. Since the minimum
width here is `0`, laying things out with `MinContent` causes the
Markdown table to shrink completely. What we want instead is for the
minimum width to be the min-content size, but only for Markdown rendered
inside popovers.

This PR does exactly that, without interfering with the `grid_cols` API,
which intentionally follows a TailwindCSS-like convention. See
https://github.com/zed-industries/zed/pull/44368 for context.

Release Notes:

- N/A

Smit Barmase created

ba24ac7 fix: updated cursor linux keymap to use new AcceptNextWordEditPrediction (#44971)

Click to expand commit body
### Problem

PR #44411 replaced the `editor::AcceptPartialEditPrediction` action with
`editor::AcceptNextLineEditPrediction` and
`editor::AcceptNextWordEditPrediction`. However, the Linux cursor keymap
wasn't updated to reflect this change, causing a panic on startup for
Linux users.

### Solution

Updated the Linux keymap configuration to reference the new actions

Release Notes:

- N/A

Luca created

2178ad6 Remove unneccessary snapshot storing in the buffer chunks (#44972)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>

Kirill Bulatov and Lukas Wirth created

c3b0860 Remove CopyAsMarkdown (#44933)

Click to expand commit body
Copying rendered markdown doesn't reliably do anything sensible. If we
copy text from the middle of a bold section, no formatting is copied. If
we copy text at the end, the trailing bold delimiters are copied,
resulting in gibberish markdown. Thus even fixing the associated issue
(so that leading delimeters are reliably copied) won't consistently
produce good results.

Also, as the user messages in the agent panel don't render markdown
anyway, it seems the most likely use case for copying markdown is
inapplicable.

Closes #42958 

Release Notes:

- N/A

Michael Benfield created

33b71ae workspace: Use markdown to render LSP notification content (#44215)

Click to expand commit body
Closes #43657

Release Notes:

- Improved LSP notification messages by adding markdown rendering with
clickable URLs, inline code, etc.

<table>
  <tr>
    <td>Before</td>
    <td>After</td>
  </tr>
  <tr>
<td><img width="408" height="153" alt="screenshot-notification-before"
src="https://github.com/user-attachments/assets/53b026de-335f-4c39-937f-590c3b7ea571"
/></td>
<td><img width="408" height="153" alt="screenshot-notification-after"
src="https://github.com/user-attachments/assets/9d6a7baa-8304-4a52-a5d0-0bacf7ea69f9"
/></td>
  </tr>
</table>

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Mayank Verma and Danilo Leal created

4109c9d workspace: Display a launchpad page when in an empty window & add it as a `restore_on_startup` value (#44048)

Click to expand commit body
Hi,

This PR fixes nothing. I just miss the option to open recent projects
quickly upon opening Zed, so I made this. Hope I can see it soon in
Preview channel.
If there is any suggestion, just comment. I will take it seriously.

Thank you!

|ui|before|after|
|-|-|-|
|empty pane|<img width="1571" height="941" alt="Screenshot 2025-12-03 at
12 39 25"
src="https://github.com/user-attachments/assets/753cbbc5-ddca-4143-aed8-0832ca59b8e7"
/>|<img width="1604" height="952" alt="Screenshot 2025-12-03 at 12 34
03"
src="https://github.com/user-attachments/assets/2f591d48-ef86-4886-a220-0f78a0bcad92"
/>|
|new window|<img width="1571" height="941" alt="Screenshot 2025-12-03 at
12 39 21"
src="https://github.com/user-attachments/assets/a3a1b110-a278-4f8b-980e-75f5bc96b609"
/>|<img width="1604" height="952" alt="Screenshot 2025-12-04 at 10 43
17"
src="https://github.com/user-attachments/assets/74a00d91-50da-41a2-8fc2-24511d548063"
/>|

---

Release Notes:

- Added a new value to the `restore_on_startup` setting called
`launchpad`. This value makes Zed open with a variant of the welcome
screen ("the launchpad") upon startup. Additionally, this same page
variant is now also what is displayed if you close all tabs in an
existing window that doesn't contain any folders open. The launchpad
page shows you up to 5 recent projects, making it easy to open something
you were working recently.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Simon Pham and Danilo Leal created

9ec147d Update Copilot sign-up URL based on verification domain (#44085)

Click to expand commit body
Use the url crate to extract the domain from the verification URI and
construct the appropriate Copilot sign-up URL for GitHub or GitHub
Enterprise.

Release Notes:

- Improved github enterprise (ghe) copilot sign in

Moritz Bitsch created

9c32c29 Revert "Add save_file and restore_file_from_disk agent tools" (#44949)

Click to expand commit body
Reverts zed-industries/zed#44789

Need to fix a bug

Release Notes:

- N/A

Nathan Sobo created

a176a8c agent: Allow LanguageModelImage size to be optional (#44956)

Click to expand commit body
Release Notes:

- Improved allow LanguageModelImage size to be optional

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>

Xiaobo Liu created

9d4d37a Revert "editor: Refactor cursor_offset_on_selection field in favor of VimModeSettings" (#44960)

Click to expand commit body
Reverts zed-industries/zed#44889

Release Notes:
- N/A

Ben Brandt created

81d8fb9 tab_switcher: Fix missing preview on initial ctrl-shift-tab press (#44959)

Click to expand commit body
Closes #44852

Release Notes:

- Fixed tab preview not showing up on initial ctrl-shift-tab press

Mayank Verma created

65e9001 docs: Add documentation for installing via winget (#44941)

Click to expand commit body
Simple documentation PR.

Added information for installing on Windows via winget. Added links from
the main README to relevant sections for both macOS and Windows

Release Notes:

- N/A

daomah created

ebd5a50 language_models: Add `auto_discover` setting for Ollama (#42207)

Click to expand commit body
First up: I'm sorry if this is a low quality PR, or if this feature
isn't wanted. I implemented this because I'd like to have this
behaviour. If you don't think that this is useful, feel free to close
the PR without comment. :)

My idea is this: I love to pull random models with Ollama to try them.
At the same time, not all of them are useful for coding, or some won't
work out of the box with the context_length set. So, I'd like to change
Zed's behaviour to not show me all models Ollama has, but to limit it to
the ones that I configure manually.

What I did is add an `auto_discover` field to the settings. The idea is
that you can write a config like this:

```json
"language_models": {
    "ollama": {
      "api_url": "http://localhost:11434",
      "auto_discover": false,
      "available_models": [
        {
          "name": "qwen3:4b",
          "display_name": "Qwen3 4B 32K",
          "max_tokens": 32768,
          "supports_tools": true,
          "supports_thinking": true,
          "supports_images": true
        }
      ]
    }
  }
```

The `auto_discover: false` means that Zed won't pick up or show the
language models that Ollama knows about, and will only show me the one I
manually configured in `available_models`. That way, I can pull random
models with Ollama, but in Zed I can only see the ones that I know work
(because I've configured them).

The default for `auto_discover` (when it is not explicitly set) is
`true`, meaning that the existing behaviour is preserved, and this is
not a breaking change for configurations.

Release Notes:

- ollama: Added `auto_discover` setting to optionally limit visible
models to only those manually configured in `available_models`

Patrick Elsen created

f760233 workspace: Fix context menu triggering format on save (#44073)

Click to expand commit body
Closes #43989

Release Notes:

- Fixed editor context menu triggering format on save

Hourann created

a1dbfd0 Fix the `file_finder::Toggle` binding (#44951)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/44752
Closes https://github.com/zed-industries/zed/pull/44756

Release Notes:

- Fixed "file_finder::Toggle" action sometimes not working in JetBrains
keymap

Kirill Bulatov created

8ef37e8 Remove outdated `Cargo.toml` comment about `declare_interior_mutable_const` (#44950)

Click to expand commit body
Since the rule is no longer a `style` lint as of
[mid-August](https://github.com/rust-lang/rust-clippy/pull/15454), the
comment mentioning it not being one is outdated and should be removed.

> [!NOTE]
> I kept the severity at `error` for now to avoid rustling feathers.
> If `warn` is preferred, feel free to change it yourself or ask me to
do it - it's only 1 line of code, after all.

Release Notes:

- N/A

Bertie690 created

6016d0b Improve autofix (#44930)

Click to expand commit body
Release Notes:

- N/A

Conrad Irwin created

ee2a4a9 Clean up screenshare (#44945)

Click to expand commit body
Release Notes:

- Fixed a bug where screen-share tabs would persist after the sender (or
receiver) had left the call.

Conrad Irwin created

829b1b5 Fix link opening (#44910)

Click to expand commit body
- **Fix editor::OpenUrl on zed links**
- **Fix cmd-clicking links too**

Closes #44293
Closes #43833

Release Notes:

- The `editor::OpenUrl` action now works for links to https://zed.dev
- Clicking on a link to a Zed channel or channel-note within the editor
no-longer redirects you via the web.

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>

Conrad Irwin and Zed Zippy created

c7d2483 Include project rules in commit message generation (#44921)

Click to expand commit body
Closes #38027

Release Notes:

- AI-generated commit messages now respect rules files (e.g.
`AGENTS.md`) if present

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>

Richard Feldman and Claude Haiku 4.5 created

b17b097 terminal: Sanitize URLs with characters that cannot be last (#43559)

Click to expand commit body
Closes #43345

The list of characters comes from the linkify crate, which is already
used for URL detection in the editor:


https://github.com/robinst/linkify/blob/5239e12e26c633f42323e51ed81b0ff534528077/src/url.rs#L228

Release Notes:

- Improved url links detection in terminals.

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>

Marco Mihai Condrache created

dfdad94 settings_ui: Add Edit keybindings button (#44914)

Click to expand commit body
Closes #ISSUE

Release Notes:

- settings_ui: Added an "Open Keymap Editor" item under the Keymap
section

Ben Kunkle created

3b2ccaf Make zed --wait work with directories (#44936)

Click to expand commit body
Fixes #23347

Release Notes:

- Implemented the `zed --wait` flag so that it works when opening a
directory. The command will block until the window is closed.

Max Brunsfeld created

a60e0a1 Improve keymap error formatting and add settings button icon (#42037)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/41938

For some error messages relating to the keymap file, the font size was
too large. This was due to the error message being a child
`MarkdownString` instead of a `SharedString`. A `.text_xs()` method is
being applied to this notification, but it appears not to affect the
markdown text. I found that the H5 text size in markdown is the same
size as other error messages, so I made each element (that had text)
that size. There was also a special case for bullet points.

I also added a gear icon to the settings button, so it was more in line
with other app notifications.

Error message (text too large):

![keymap-broke](https://github.com/user-attachments/assets/2c205a3a-ae28-419f-95c4-093340760d03)

Expected behavior (notification with correct text sizing and icon):

![keymap-fixed](https://github.com/user-attachments/assets/f8a1396b-177f-4287-b390-c3804b70f1d2)

Example behavior:

![settings](https://github.com/user-attachments/assets/09397954-781f-44be-88ad-08035fe66f0c)

Release Notes:

- Improved UI for keymap error messages.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Johnny Klucinec and Danilo Leal created

f8561b4 Anchor scroll offsets so that entire diff hunks at viewport top become visible (#44932)

Click to expand commit body
Fixes https://github.com/zed-industries/zed/issues/39258

Release Notes:

- N/A

Max Brunsfeld created

7a4de73 git: Ensure no more than 4 blame processes run concurrently for each multibuffer (#44843)

Click to expand commit body
Previously we were only awaiting on up to 4 of the blame futures at a
time, but we would still call `Project::blame_buffer` eagerly for every
buffer in the multibuffer. Since that returns a `Task`, all the blame
invocations were still launched concurrently.

Release Notes:

- N/A

Cole Miller created

b8d0da9 collab: Add `copilot-swe-agent[bot]` to the `GET /contributor` endpoint (#44934)

Click to expand commit body
This PR adds the `copilot-swe-agent[bot]` user to the `GET /contributor`
endpoint so that it passes the CLA check.

Release Notes:

- N/A

Finn Evers created

870159e git: Fix partially-staged paths not being accurately rendered (#44837)

Click to expand commit body
Updates #44089 

- Restores the ability to have a partially staged/`Indeterminate` status
for the git panel checkboxes
- Removes the `optimistic_staging` logic, since its stated purpose is
served by the `PendingOps` system in the `GitStore` (which may have
bugs, but we should fix them in the git store rather than adding another
layer)

Release Notes:

- Fixed partially-staged files not being represented accurately in the
git panel.

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Cole Miller and Anthony Eid created

0ead466 project_panel: Fix divider taking too much horizontal space (#44920)

Click to expand commit body
Closes: #44917

While setting up the project for contribution, I noticed that the
divider in the welcome dialog was rendering incorrectly on the `main`
branch compared to the latest release.

**Current behaviour (`main` branch):**
<img width="796" height="690" alt="image"
src="https://github.com/user-attachments/assets/3f7d6c73-14eb-47f3-ad83-4796f5f7be0f"
/>

**Expected behaviour (Release `0.216.1`):**
<img width="794" height="692" alt="image"
src="https://github.com/user-attachments/assets/b67857dc-a03d-4e49-bb33-22fe0c83ac5d"
/>

---

After some investigation, it looks like the issue was introduced in
#44505, specifically in [these
changes](https://github.com/zed-industries/zed/pull/44505/changes#diff-4ea61133da5775f0d5d06e67a8dccc84e671c3d04db5f738f6ebfab3a4df0b01R147-R158),
which caused the divider to take the full width instead of being
properly constrained.

**PR result**:
<img width="666" height="574" alt="image"
src="https://github.com/user-attachments/assets/e12b7778-b7cc-4855-b82e-3470dfe43365"
/>

Release Notes:

- Fixes -or- divider rendering incorrectly

Artem Molonosov created

b52f907 extension_ci: Auto-assign version bumps to GitHub actor (#44929)

Click to expand commit body
Release Notes:

- N/A

Finn Evers created

4096bc5 languages: Add injections for string and tagged template literals for JS/TS(X) (#44180)

Click to expand commit body
Hi! This pull request adds language injections for string and tagged
template literals for JS/TS(X).
This is similar to what [this
extension](https://marketplace.visualstudio.com/items?itemName=bierner.comment-tagged-templates)
provides for VSCode. This PR is inspired by this tweet
https://x.com/leaverou/status/1996306611208388953?s=46&t=foDQRPR8oIl1buTJ4kZoSQ

I've added injections queries for the following languages: HTML, CSS,
GraphQL and SQL.
This works for:

- String literals: `const cssString = /* css */'button { color: hotpink
!important; }';`
- Template literals: ```const cssString = /* css */`button { color:
hotpink !important; }`;```

All injections support the format with whitespaces inside, i.e. `/* html
*/` and without them `/*html*/`.

## Screenshots

|before|after|
|---------|-----------|
| <img width="1596" height="1476" alt="CleanShot 2025-12-04 at 21 12
00@2x"
src="https://github.com/user-attachments/assets/8e0fb758-41f0-43a8-93e6-ae28f79d7c8f"
/> | <img width="1576" height="1496" alt="CleanShot 2025-12-04 at 21 08
35@2x"
src="https://github.com/user-attachments/assets/b47bb9c1-224e-4a24-8f08-a459f1081449"
/>|

Release Notes:

- Added language injections for string and tagged template literals in
JS/TS(X)

Vitaly Slobodin created

97f6cda Add an autofix workflow (#44922)

Click to expand commit body
One of the major annoyances with writing code with claude is that its
poorly indented; instead of requiring manual intervention, let's just
fix that in CI.

Similar to https://autofix.ci, but as we already have a github app,
we can do it without relying on a 3rd party.

This PR doesn't trigger the workflow (we need a separate change in Zippy
to do
that) but will let me test it manually.

Release Notes:

- N/A

Conrad Irwin created

5987dff Add save_file and restore_file_from_disk agent tools (#44789)

Click to expand commit body
Release Notes:

- Added `save_file` and `restore_file_from_disk` tools to the agent,
allowing it to resolve dirty buffer conflicts when editing files. When
the agent encounters a file with unsaved changes, it will now ask
whether you want to keep or discard those changes before proceeding.

Nathan Sobo created

eceece8 docs: Update links to account page (#44924)

Click to expand commit body
This PR updates the links to the account page to point to the Dashboard.

Release Notes:

- N/A

Marshall Bowers created

faef5c9 docs: Drop deprecated key from settings for Agent Panel (#44923)

Click to expand commit body
The `version` key was deprecated a while ago.

Release Notes:

- N/A

Kunall Banerjee created

47a6bd2 Terminal ANSI colors (#44912)

Click to expand commit body
Closes #38992 

Release Notes:

- N/A

---------

Co-authored-by: dangooddd <dangoodds@gmail.com>

Matt Miller and dangooddd created

c7a1852 collab: Add `dependabot[bot]` to the `GET /contributor` endpoint (#44919)

Click to expand commit body
This PR adds the `dependabot[bot]` user to the `GET /contributor`
endpoint so that it passes the CLA check.

Release Notes:

- N/A

Finn Evers created

ee6469d project: Clear worktree settings when worktrees get removed (#44913)

Click to expand commit body
Release Notes:

- N/A *or* Added/Fixed/Improved ...

Lukas Wirth created

9e11aae Add ZoomIn and ZoomOut actions for independent zoom control (#44587)

Click to expand commit body
Closes #14472

Introduces `workspace::ZoomIn` and `workspace::ZoomOut` actions that
complement the existing `workspace::ToggleZoom` action. ZoomIn only
zooms if not already zoomed, and ZoomOut only zooms out if currently
zoomed. This enables composing zoom actions with
`workspace::SendKeystrokes` for workflows like "focus terminal then zoom
in".


<details><summary>Example usage</summary>
<p>

Example keybindings:

```json
[
  {
    "bindings": {
      "ctrl-cmd-,": "terminal_panel::ToggleFocus",
      "ctrl-cmd-.": "workspace::ZoomIn",
    }
  },
  {
    "context": "Terminal",
    "bindings": {
      "cmd-.": "terminal_panel::ToggleFocus"
    }
  },
  {
    "context": "!Terminal",
    "bindings": {
      "cmd-.": ["workspace::SendKeystrokes", "ctrl-cmd-, ctrl-cmd-."]
    }
  },
]
```

Demo:


https://github.com/user-attachments/assets/1b1deda9-7775-4d78-a281-dc9622032ead

</p>
</details> 



Release Notes: 

- Added the actions: `workspace::ZoomIn` and `workspace::ZoomOut` that
complement the existing `workspace::ToggleZoom` action

pedroni created

fb574d8 Inline assistant: Clear failure text when regenerating (#44911)

Click to expand commit body
Release Notes:

- N/A

Michael Benfield created

523f093 editor: Use Tree-sitter scopes to calculate quote autoclose (#44281)

Click to expand commit body
Closes #44233

Release Notes:

- Fixed quote autoclose incorrectly counting quotes inside strings

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

Mayank Verma and Ben Kunkle created

2441dc3 gpui: Take advantage of unified memory on Apple silicon (#44273)

Click to expand commit body
Metal chooses a buffer’s default storage mode based on the type of GPU
in use.
On Apple GPUs, the default mode is shared, which allows the CPU and GPU
to access the same memory without requiring explicit synchronization.
On discrete or external GPUs, Metal instead defaults to managed storage,
which does require explicit CPU–GPU memory synchronization.

This change aligns our buffer usage with Metal’s default behavior and
avoids unnecessary synchronization on Apple-silicon Macs. As a result,
memory usage on Apple hardware is reduced and performance improves due
to fewer sync operations.

Ref:
https://developer.apple.com/documentation/metal/setting-resource-storage-modes
Ref:
https://developer.apple.com/documentation/metal/synchronizing-a-managed-resource-in-macos

With the storage mode:

<img width="356" height="74" alt="image"
src="https://github.com/user-attachments/assets/e5a5bf9a-f339-417b-b5ab-818d8f692bd1"
/>

On main branch:

<img width="356" height="74" alt="image"
src="https://github.com/user-attachments/assets/6ccd77fe-7929-4423-9696-671d185ceffb"
/>

That's a 44% reduction of memory usage.

Release Notes:

- Reduced memory usage on Apple-silicon Macs by using shared memory
where appropriate

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>

Marco Mihai Condrache created

969e9a6 Fix micromamba not initializing shell (#44646)

Click to expand commit body
Closes #44645

This is a continuation of #40577

Release Notes:
- initializes micromamba based on the shell

Casper van Elteren created

dbab71e Add `.claude/settings.local.json` to `.gitignore` (#44905)

Click to expand commit body
Ignore people's local Claude Code settings

Release Notes:

- N/A

Agus Zubiaga created

c75d880 Check for local files from within surrounding parens (#44733)

Click to expand commit body
Closes #18228

We parse local clickable links by looking for start/end based on
whitespace. However, this means that we don't catch links which are
embedded in parenthesis, such as in markdown syntax:
`[here's my link text](./path/to/file.txt)`

Parsing strictly against parenthesis can be problematic, because
strictly-speaking, files can have parenthesis. This is a valid file name
in at least MacOS:
`thisfilehas)parens.txt`

Therefore, this change adds a small regex layer on top of the filename
finding logic, which parses out text within parenthesis. If any are
found, they are checked for being a valid filepath. The original
filename string is also checked in order to preserve behavior.

Before:


https://github.com/user-attachments/assets/37f60335-e947-4879-9ca2-88a33f5781f5

After:



https://github.com/user-attachments/assets/bd10649e-ad74-43da-80f4-3e7fd56abd86



Release Notes:

- Improved link parsing for cases when a link is embedded in
parenthesis, e.g. markdown

KyleBarton created

3076c4e Add behavior for multiple click and drag to markdown component (#43813)

Click to expand commit body
Closes #43354

Overview:
In a diagnostic panel (and all Markdown derived panels, including
function hint popovers and the like), the expected behavior is that when
a user double clicks a word, the whole word is highlighted. If they
double click and hold, then drag, the text selection proceeds word by
word. There is similar behavior for triple click which goes line by
line, and quadruple click which selects all text.

Before this fix, the DiagnosticPopover allowed the user to click and
drag, but double click and drag reverts to selecting text character by
character. The same wrong behavior is shown for triple click (line).
Quadruple click (all text) was not previously implemented in
MarkdownElement.

Quick example of wrong behavior, showing single click and drag, double
click and drag, triple click and drag, then quadruple click (fails).


https://github.com/user-attachments/assets/1184e64d-5467-4504-bbb6-404546eab90a


Quick example showing the correct behavior fixed in this PR:


https://github.com/user-attachments/assets/06bf5398-d6d6-496c-8fe9-705031207f05



Nota bene:
I'm not a rust dev, so a lot of this relied on my C/C++ experience,
cribbing from elsewhere in the repo, and help from Claude. If that's not
ok for this project, I totally understand.

Much of this was informed by editor.rs, using a similar pattern to
SelectMode in there (see lines 450, and begin_selection and
extend_selection). It didn't seem appropriate to import SelectMode from
there (also Markdown range and Anchor range seemed different enough),
nor did it seem appropriate to move SelectMode to markdown.rs.

The tests are non-ui based, instead testing the relevant functions. Not
sure if that's what's expected.

Release Notes:

- Double- and triple-click selection now correctly expands by word and
by line within Markdown elements (diagnostics, agent panel, etc.).

RMcGhee created