2c29eac
Fetch all staff in get-preview-channel-changes script (#37940)
Click to expand commit body
Release Notes: - N/A
Joseph T. Lyons created
2c29eac
Fetch all staff in get-preview-channel-changes script (#37940)
Release Notes: - N/A
Joseph T. Lyons created
a94b093
editor: Fix cuts on end of line cutting whole line (#34553)
Closes #19816
Release Notes:
- Improved `ctrl-k` (`editor::CutToEndOfLine`) behavior when used at the
end of lines
- Add option to make `editor::CutToEndOfLine` not gobble newlines.
```json
{
"context": "Editor",
"bindings": { "ctrl-k": ["editor::CutToEndOfLine", { "stop_at_newlines":
true }] }
},
```
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
AidanV and Peter Tripp created
441a934
Remove unnecessary `Option` from functions querying buffer outline (#37935)
`None` case wasn't being used Release Notes: - N/A
Michael Sloan created
b28c979
language_settings: Add whitespace_map setting (#37704)
This setting controls which visible characters are used to render whitespace when the show_whitespace setting is enabled. Release Notes: - Added `whitespace_map` setting to control which visible characters are used to render whitespace when the `show_whitespace` setting is enabled. --------- Co-authored-by: Nia Espera <nia@zed.dev>
Ilija Tovilo and Nia Espera created
22e31a0
Fix crash when filtering items in Picker (#37929)
Closes #37617 We're already using `get` in a bunch of places, this PR updates the remaining spots to follow the same pattern. Note that the `ix` we read in `render_match` can sometimes be stale. The likely reason is that we run the match-update logic asynchronously (see [here](https://github.com/zed-industries/zed/blob/138117e0b15664079f5526cb56168750382b49b9/crates/picker/src/picker.rs#L643)). That means it's possible to render items after the list's [data update](https://github.com/zed-industries/zed/blob/138117e0b15664079f5526cb56168750382b49b9/crates/picker/src/picker.rs#L652) but before the [list reset](https://github.com/zed-industries/zed/blob/138117e0b15664079f5526cb56168750382b49b9/crates/picker/src/picker.rs#L662), in which case the `ix` can be greater than that of our updated data. Release Notes: - Fixed crash when filtering MCP tools.
Smit Barmase created
c0b583c
keymap_editor: Move OpenKeymapEditor action into zed_actions (#37928)
This lets us remove title_bar's dependency on keymap_editor, which in turns improves dev build times by ~0.5s for me Release Notes: - N/A
Piotr Osiewicz created
6441099
gpui: Fix blending of colors in `HighlightStyle::highlight` (#37666)
Whilst looking into adding support for RainbowBrackes, we stumbled upon this: Whereas for all properties during this blending, we take the value of `other` if it is set, for the color we actually take `self.color` instead of `other.color` if `self.color` is at full opacity. `Hsla::blend` returns the latter color if it is at full opacity, which seems wrong for this case. Hence, this PR swaps these. Will not merge before the next release, to ensure that we don't break something somewhere unexpected. Release Notes: - N/A
Finn Evers created
611b966
Fix typo in development docs for Windows and Linux (#37925)
Fixes same typo ("collabortation") as #37607 but for the Windows and
Linux dev docs.
Release Notes:
- N/A
Andy Brauninger created
630340d
agent: Fix mention completion sometimes not dismissing on space (#37922)
Previously we would still show a completion menu even when the user typed an unrecognised mode with an argument, e.g. `@something word`. This PR ensures that we only show the completion menu, when the part after the `@` is a known mode (e.g. `file`/`symbol`/`rule`/...) Release Notes: - Fix an issue where completions for `@mentions` in the agent panel would sometimes not be dismissed when typing a space
Bennet Bo Fenner created
acb3406
editor: Wrap placeholder if text overflows (#37919)
This fixes an issue where long placeholders would be cut off, e.g. in a Claude Code thread: <img width="387" height="115" alt="image" src="https://github.com/user-attachments/assets/831a54aa-cf2b-4d87-af86-e368a5936f6b" /> Now: <img width="354" height="115" alt="image" src="https://github.com/user-attachments/assets/e5df5e05-0869-4db2-8dee-38611263191c" /> Most of the changes in this PR are caused by us requiring `&mut Window` in `set_placeholder_text`. Release Notes: - Fixed an issue where placeholders inside editors would not wrap --------- Co-authored-by: Agus Zubiaga <agus@zed.dev>
Bennet Bo Fenner and Agus Zubiaga created
fb3c991
Bump Zed to v0.205 (#37917)
Release Notes: -N/A
Joseph T. Lyons created
d110d32
languages: Remove broken pixi environment activation (#37915)
Closes [#ISSUE](https://github.com/zed-industries/zed/issues/37895) This needs more thought behind it to be implemented properly Release Notes: - N/A
Lukas Wirth created
2cf3def
acp: Add keybindings for authorizing tool calls (#37876)
TODO: - [x] Double-check if we like the naming of the new actions - [x] Only show keybinding hint once per option (e.g. if there are two `allow_once` buttons only show it on the first one) - [x] If there are multiple tool calls that need authorisation, only show keybindings on the first tool call - [x] Figure out which keybindings to use - [x] Add linux keybindings - [x] Add windows keybindings - [x] Bug: long keybindings can make the buttons overflow Release Notes: - Add keybindings for authorizing tool calls (`agent: Allow once`, `agent: Allow always`, `agent: Reject once`) in the agent panel --------- Co-authored-by: Agus Zubiaga <agus@zed.dev>
Bennet Bo Fenner and Agus Zubiaga created
df2d097
editor: Fix adjacent custom highlights interfering with each other (#37912)
Release Notes: - Fixed matching bracket highlighting not highlighting closing brackets when adjacent to each other Co-authored-by: Finn Evers <finn@zed.dev>
Lukas Wirth and Finn Evers created
fcdd427
Revert "markdown: Add support for inline HTML `img` tags inside text (#37264)" (#37893)
This reverts commit e1a5d299721bf14a7cdd41a5ae1bd03ea948c00e. This have regressed Zed release notes' wrapping which we do not want to do on a release day: https://github.com/zed-industries/zed/pull/37264#issuecomment-3265420442 Release Notes: - N/A
Kirill Bulatov created
9c548a0
workspace: Fix tab bar drop target height when no unpinned tabs present (#37884)
Before: <img width="846" height="192" alt="Screenshot 2025-09-10 at 4 44 18 AM" src="https://github.com/user-attachments/assets/3c79e140-e2b2-4e50-9fce-cb182e46d878" /> After: <img width="846" height="192" alt="Screenshot 2025-09-10 at 4 43 13 AM" src="https://github.com/user-attachments/assets/b5fa853d-ce39-4c81-9773-1d84eebc8cbb" /> Release Notes: - Fixed height of the drop background in the tab bar when no unpinned tabs are present.
Smit Barmase created
bd0a5dd
Potentially fix welcome banner in agent panel not going away (#37879)
Potentially fixes #37367. Just going ahead with the change even though it's unclear whether this is the fix, since it is quite low risk. Release Notes: - N/A
Michael Sloan created
2f40a3b
keymap validation: Improve message for action that takes no input (#37877)
See https://github.com/zed-industries/zed/issues/26370#issuecomment-3200022302 Before (user screenshot): <img width="650" height="127" alt="Image" src="https://github.com/user-attachments/assets/9548ce43-657e-46ef-b6be-b95489167ac2" /> After (my screenshot): <img width="616" height="229" alt="image" src="https://github.com/user-attachments/assets/09028305-e7bb-4a31-bb87-55effbec26f3" /> Release Notes: - N/A
Michael Sloan created
304af66
Fix import not working on first column first row of file (#37746)
Closes #26136 Release Notes: - fixed auto import not working on first column, first row of file
Mitch (a.k.a Voz) created
d2886d6
ollama: Add mistral-nemo (#37723)
Adding mistral nemo, sorting by name and adding comment about clamp sizing Release Notes: - Added support for mistral-nemo --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Santiago Bernhardt and Conrad Irwin created
cffb883
Consistently map syntax node navigation actions on macOS (#37874)
Skipping Linux and Windows keymaps here, as it's hard to find a
consistent base-binding for all 4 actions across all platforms that
don't break important actions for each keymap. Someone else can think on
that and make a proposal.
Release Notes:
- Added bindings for navigating between sibling nodes in the syntax tree
on macOS (`cmd-ctrl-{up/down}` for `SelectPreviousSyntaxNode` and
`SelectNextSyntaxNode`). Breaking change: the existing syntax tree
parent/child navigation bindings have moved from
`ctrl-shift-{left/right}` to `cmd-ctrl-{left/right}` to create a unified
four-directional navigation pattern where all syntax tree operations use
the same modifier combination. We could not use the previous base
modifiers without breaking more bindings.
Joseph T. Lyons created
eb7154d
Skip "open this directory" menu entry in case of errors (#37872)
Follow-up of https://github.com/zed-industries/zed/pull/37564 Release Notes: - N/A
Kirill Bulatov created
18c6d9d
Fix SVG preview not refreshing on external file changes (#37316)
Closes #37208 ## Release Notes: - Fixed: SVG preview now refreshes automatically when files are modified by external programs ## Summary Previously, SVG preview would only refresh when files were saved within the Zed editor, but not when modified by external programs (like scripts, other editors, etc.) ## What Changed The SVG preview now subscribes to file system events through the worktree system. When an external program modifies an SVG file, the worktree detects the change and notifies the preview. The preview then clears its cache and refreshes to show the updated content. ## Before the fix https://github.com/user-attachments/assets/e7f9a2b2-50f9-4b43-95e9-93a0720749f5 ## After the fix https://github.com/user-attachments/assets/b23511e3-8e59-45a1-b29b-d5105d32bd2c AI Usage: Used Cursor for code generation
0xshadow created
414d3be
Set usePlaceholders to match Go default (#37551)
Closes #33629 Release Notes: - changed gopls default to match what Go specifies https://github.com/golang/tools/blob/master/gopls/doc/settings.md#useplaceholders-bool
Mitch (a.k.a Voz) created
0862a0b
git: Add uncommit action (#37031)
Closes #36767 Release Notes: - Add uncommit action for git
Alvaro Parker created
2e36e97
language_models: Make Copilot Chat resilient to new model vendors and add tokenizer-based token counting (#37118)
While working on fixing this: #37116. I reliased the current implementation of github copilot is not truly resilient to upstream changes. This PR enhances GitHub Copilot Chat to be forward-compatible with new AI model vendors and improves token counting accuracy by using vendor-specific tokenizers from the GitHub Copilot API. The system previously failed when GitHub added new model vendors like xAI with deserialization errors, and token counting wasn't utilizing the vendor-specific tokenizer information provided by the API. The solution adds an Unknown variant to the ModelVendor enum with serde other attribute to gracefully handle any new vendors GitHub introduces, implements tokenizer-aware token counting that uses the model's specified tokenizer mapping o200k_base to gpt-4o with fallback, adds explicit support for xAI models with proper tool input format handling, and includes comprehensive test coverage for unknown vendor scenarios. Key changes include adding the tokenizer field to model capabilities, implementing the tokenizer method on models, updating tool input format logic to handle unknown vendors, and simplifying token counting to use the vendor's specified tokenizer or fall back to gpt-4o. This ensures Zed's Copilot Chat integration remains robust and accurate as GitHub continues expanding their AI model provider ecosystem. Release Notes: - Enhanced model vendor compatibility to automatically support future AI providers and improved token counting accuracy using vendor-specific tokenizers from the GitHub Copilot --------- Signed-off-by: Umesh Yadav <git@umesh.dev>
Umesh Yadav created
1751bf4
Allow outline modal toggling (#37575)
Closes #37511 The outline modal seems to have a bug where if it's open and the `outline::Toggle` is triggered, it would not close if there was another command with the same keybind. So instead, if the outline modal is open and an `outline::Toggle` is triggered, we dismiss the modal. Release Notes: - Fixed a bug where `outline::Toggle` would sometimes not close outline modal
Mitch (a.k.a Voz) created
2fae4c7
vim: Make indenting selected lines with `>` and `<` in Helix mode no longer deselect them (#37665)
Improves Helix compatibility by making the Indent keybinds `<` and `>` no longer deselect lines if they're selected. Post Indent action current Zed release: <img width="485" height="271" alt="image" src="https://github.com/user-attachments/assets/41fd3d94-9c89-49dd-adc5-f696dbd79827" /> (Cursor is on the beginning of the first line) Post Indent action in Helix: <img width="376" height="144" alt="image" src="https://github.com/user-attachments/assets/fdd1a489-cf3a-4638-9199-3adffa63ef61" /> Post Indent action in this PR: <img width="463" height="300" alt="image" src="https://github.com/user-attachments/assets/8edd3b81-e446-4b55-bc90-61cac3661ed7" /> Release Notes: - Fixed selected lines indented with `<` and `>` deselecting in Helix mode
Jonathan Hart created
1ae3d25
Improve Markdown highlighting (#37669)
Release Notes:
- Improved Markdown syntax highlighting
PR #25330 raised concerns about breaking changes, so I split it into two
PRs:
- This PR improves highlighting without deprecating existing selectors.
- PR #37670 is based on this PR and introduces new Markdown selectors.
| Zed 0.202.7 | With this PR |
| --- | --- |
| <img width="800" height="1080" alt="md-0 202 7"
src="https://github.com/user-attachments/assets/0b0b5920-32ed-454f-bc3b-bf5cd0a9086a"
/> | <img width="800" height="1080" alt="md-pr"
src="https://github.com/user-attachments/assets/a5923a2e-391e-4e09-a60b-1a142f9378f3"
/> |
Changes to include the `markup` selector, conforming to
[Neovim](https://github.com/nvim-treesitter/nvim-treesitter/blob/38e46a6d7ade5c8718f77b2b9fd98a0f7ab32c1e/queries/markdown/highlights.scm#L59),
[VS
Code](https://github.com/microsoft/vscode/blob/dfad570d15959a6ce7210a313a1190e76e8fe2e2/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json#L60),
[Atom](https://github.com/atom/language-gfm/blob/6686ac6ccca2632af24d5c200f85bcd80b9fa752/grammars/gfm.json#L147),
and [Zed
itself](https://github.com/zed-industries/zed/blob/1e255e41ccfdb88e2266469f1ccfe0d41533280b/crates/languages/src/gitcommit/highlights.scm#L1).
- `paragraph`, `indented_code_block`, `pipe_table`: `text`
- `# Heading`: `title` -> `title.markup`
- `-`, `1.`, `>`, `|`: `punctuation.markup`
- ```` ``` ````: `punctuation.embedded.markup`
- `[1]: url.com`, `[link](url.com)`: `link_text.markup`
- `url.com`: `link_uri` -> `link_uri.markup`
- `*italic*`: `emphasis` -> `emphasis.markup`
- `**bold**`: `emphasis.strong` -> `emphasis.strong.markup`
- ``` `raw` ```: `text.literal` -> `text.literal.markup`
- `~~strikethrough~~`: `strikethrough.markup`
````md
# Heading
Some stylized text:
- `raw`
- *italic*
- ~strike~
- **strong**
> quoted
```python
print("some code")
```
1. Here is an 
2. A [link](https://github.com/zed-industries)
3. And even a [referenced link][1]
[1]: https://zed.dev
| tables | are |
| --- | --- |
| properly | scoped |
````
chbk created
5e58f44
Fix auth in edit_agent evals (#37869)
Somehow we have a regression where the auth wasn't being called, so the model didn't exist. Looking at the code, it is likely this was relying on some other part of the code doing the auth, since the order wouldn't have worked before without that happening. This new order of doing auth before checking for available models should fix it going forward. Release Notes: - N/A
Ben Brandt created
d8085d3
zed: Hide Install CLI menu button on Windows (#37843)
The "Install CLI" menu button and `install_cli::Install` action are effectively no-op on Windows since the CLI is directly available in Windows Terminal (CMD prompt, PowerShell, etc.) after the user runs Zed installer package. Release Notes: - N/A Co-authored-by: Peter Tripp <peter@zed.dev>
Jakub Konka and Peter Tripp created
707d0e6
settings ui: Add text field support to ui layer (#37868)
This is an initial implementation that isn't used for any settings yet, but will be used once `Vec<String>` is implemented. I also updated the window.with_state api to grant access to a `Context<S>` app reference instead of just an App. ## Example <img width="603" height="83" alt="Screenshot 2025-09-09 at 2 15 56 PM" src="https://github.com/user-attachments/assets/7b3fc350-a157-431f-a4bc-80a1806a3147" /> Release Notes: - N/A
Anthony Eid created
46fb521
git_ui: Show author name on commits in branch picker (#36812)
See related discussion https://github.com/zed-industries/zed/discussions/36511. <img alt="zed" src="https://github.com/user-attachments/assets/da7fc30d-2504-48f4-a392-7c8d5cd8acb1" /> Release Notes: - Added option to show the author name in a branch picker commit information --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Lev Zakharov and Conrad Irwin created
9529cd1
project_panel: Add action to open file in split pane (#36973)
Closes #18605 Related: - https://github.com/zed-industries/zed/discussions/16901 - https://github.com/zed-industries/zed/issues/10549 Adds an action to open file in split pane. Also updates vim keybindings for better compatibility with netrw: [“v”](https://github.com/vim/vim/blob/bc461f952d854ffbde83eb74044efc3b329ea10e/runtime/pack/dist/opt/netrw/doc/netrw.txt#L1091) and [“o”](https://github.com/vim/vim/blob/bc461f952d854ffbde83eb74044efc3b329ea10e/runtime/pack/dist/opt/netrw/doc/netrw.txt#L1075) keys should open file in splits. <table> <tr> <td><video src="https://github.com/user-attachments/assets/e24c6fd4-4eb0-407a-bdd1-5300908ea2a1"> <td><video src="https://github.com/user-attachments/assets/fa0b8105-41a9-4421-a3cc-89244a90d67a"> </table> Release Notes: - Added `project_panel::OpenSplitVertical` and `project_panel::OpenSplitHorizontal` actions for opening file in a splits.
Ivan Trubach created
14ffd7b
editor: Implement Go to next/prev Document Highlight (#35994)
Closes #21193 Closes #14703 Having the ability to navigate directly to the next symbolHighlight/reference lets you follow the data flow of a variable. If you highlight the function itself (depending on the LSP), you can also navigate to all returns. Note that this is a different feature from navigating to the next match, as that is not language-context aware. For example, if you have a var named foo it would also navigate to an unrelated variable fooBar. Here's how this patch works: - The editor struct has a background_highlights. - Collect all highlights with the keys [DocumentHighlightRead, DocumentHighlightWrite] - Depending on the direction, move the cursor to the next or previous highlight relative to the current position. Release Notes: - Added `editor::GoToNextDocumentHighlight` and `editor::GoToPreviousDocumentHighlight` to navigate to the next LSP document highlight. Useful for navigating to the next usage of a certain symbol.
Marco Munizaga created
9431c65
git: Improve error messages (#35946)
Release Notes: - Improved git error messages Includes stderr in the error message for git commands, provides better output for things like errors when switching branches. Before: <img width="702" height="330" alt="image" src="https://github.com/user-attachments/assets/f32402ae-b85c-4b0b-aae8-789607e8ec9e" /> After: <img width="650" height="575" alt="image" src="https://github.com/user-attachments/assets/308dbe3c-1ff9-40b9-a187-1e12d2488c80" /> --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Jacob and Conrad Irwin created
b2d7e34
Update Editor::select_larger_syntax_node (#36971)
When the cursor was sitting on a syntactically insignificant character,
like a `{` or `,`, this function was selecting only that character, when
what the user likely wanted was to select the next larger syntax node.
Those punctuation characters all seemed to be not "named", in
tree-sitter terminology, so I updated the function to walk up the node
tree until it found a node where `is_named()` is true.
Closes #4555
Also, while writing the tests, the output of a failing test with the
wrong thing selected was harder to read than it needed to be.
It used to output a diff of ranges, like this:
<img width="217" height="111" alt="image"
src="https://github.com/user-attachments/assets/00de53a8-8776-47aa-8101-5a5b5bc3fa5e"
/>
I leveraged the existing `generate_marked_text` helper function and
updated the assertion to output a diff of the text with the selection
markers:
<img width="211" height="116" alt="image"
src="https://github.com/user-attachments/assets/53b2b882-2676-4c70-8718-e2e2ba6f254e"
/>
Happy to make that a separate PR, if needed.
Release Notes:
- Fixed Editor select_larger_syntax_node to be smart about punctuation.
Paul Sadauskas created
61d4718
Make it possible to support GPUI in the scheduler crate (#37849)
Added features that weren't needed in our cloud code. Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev>
Antonio Scandurra and Nathan created
9e903c9
Add path/status sorting toggle to git panel menu (#35704)
Adds a new menu option to toggle between sorting git entries by path or status, with settings integration Release Notes: - Git Panel: Added toggle to switch between sorting git panel entries by path or by status (available in git panel ellipsis menu) --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
nick-kilian and Conrad Irwin created
d81479e
Allow user-defined worktree names in title bar and platform windows (#36713)
Closes #36637 Release Notes: - Adds the ability to specify a human-readable project name for each worktree. https://github.com/user-attachments/assets/ce980fa6-65cf-46d7-9343-d08c800914fd
Warpten created
a2edd56
python: Add import paths to Pyright/BasedPyright completion items (#37865)
Release Notes: - python: Added package origin to completions from Pyright/BasedPyright
Piotr Osiewicz created
d7a9be0
acp: Ensure connection subprocess gets killed on drop (#37858)
It appears that in macOS, the `AcpConnection._wait_task` doesn't always get dropped when quitting the app. In these cases, the subprocess would be kept alive because we move the `child` into it. Instead, we will now explicitly kill it when `AcpConnection` is dropped. It's ok to do this because when the connection is dropped, the thread is also dropped, so there's no need to report the exit status to it. Closes #37741 Release Notes: - Claude Code: Fix subprocess leak on app quit
Agus Zubiaga created
cdbddc2
Allow unauthenticated commit models to show (#37857)
Closes #37462 Closes #37814 Release Notes: - Fixed a bug where the commit generation message would not always show
Conrad Irwin created
f397294
Fix git staging in a subfolder (#37860)
Closes #37418 Ideal fix for this would be #37855 but that is a large refactor so implementing this as a workaround. Release Notes: - N/A
localcc created
8527dcf
git_ui: Better handle commit message amend (#35268)
Follow up to this: #35114 * Previously we were still showing the commit message even after cancelling amend which was the old commit message. * This PR fixes that by restoring the commit message to the old state before the amend begin so that in case user typed a commit message it's shown if not then it's not. Before: https://github.com/user-attachments/assets/e0edcfff-863d-4367-a7c4-8a2998e702ca After: https://github.com/user-attachments/assets/9daf9be0-8a3d-4914-91a4-567693711b6b Release Notes: - Resolved an issue where cancelling an amend commit would incorrectly leave the old commit message in the input field. The commit message box now properly reverts to its pre-amend state.
Umesh Yadav created
7f607a9
git_ui: Show current branch first in branch picker (#35138)
Closes #ISSUE Release Notes: - Put current branch first in branch picker
Guillaume Launay created
5e397e8
acp: Support session modes (e.g. CC plan mode) (#37632)
Adds support for [ACP session modes](https://github.com/zed-industries/agent-client-protocol/pull/67) enabling plan and other permission modes in CC: https://github.com/user-attachments/assets/dea18d82-4da6-465e-983b-02b77c6dcf15 Release Notes: - Claude Code: Add support for plan mode, and all other permission modes --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Richard Feldman <oss@rtfeldman.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Agus Zubiaga , Bennet Bo Fenner , Richard Feldman , and Danilo Leal created
ad02f6b
cloud_llm_client: Add another `Plan` variant (#37852)
This PR adds a corresponding `FreeV2` variant to the `Plan`. Release Notes: - N/A
Marshall Bowers created
2e7607c
python: Fix instability of Pyright/BasedPyright code completions (#37850)
Pyright sets different `sortText` based on whether a given completion item was recently resolved. This probably lines up with VSCode's way of resolving items, but it's a no-no for us, as it makes completions unstable. Closes #9983 Release Notes: - python: Fixed code completions having arbitrary order when using Pyright/basedpyright
Piotr Osiewicz created
0ac1752
terminal: Sanitize trailing periods in URL detection (#37684)
Fixes #12338, related to #37616 This change improves URL detection in the terminal by removing trailing periods that appear to be sentence punctuation rather than part of the URL structure. It builds upon the parentheses sanitization work from #37076 by consolidating both approaches into a unified `sanitize_url_punctuation` function. ## Changes - Combines parentheses and period sanitization into a single `sanitize_url_punctuation` function - Uses optimized single traversal with `fold()` for parentheses counting (addressing code review feedback) - Removes trailing periods using heuristics to distinguish sentence punctuation from legitimate URL components - Removes multiple trailing periods (always considered punctuation) - Removes single trailing periods when they appear after alphanumeric characters or slashes - Preserves periods that are part of legitimate URL structure (e.g., version numbers, IP addresses, subdomains) - Maintains existing parentheses balancing logic from #37076 ## Implementation Details - **Parentheses handling**: Counts opening and closing parentheses, removes trailing `)` when unbalanced - **Period handling**: Uses `take_while()` iterator for efficient period counting - **Performance**: Single pass counting with optimized loop to avoid redundant work - **Code clarity**: Uses let-else pattern for readable conditional logic ## Testing - Added comprehensive test coverage for both parentheses and period sanitization - Tests cover balanced vs unbalanced parentheses cases - Tests cover various period scenarios including legitimate URL periods vs sentence punctuation - All existing tests continue to pass ## Release Notes - Improved terminal URL detection by further trimming trailing punctuation. URLs ending with periods (like `https://example.com.`) and unbalanced parentheses (like `https://example.com/path)`) are now properly detected without including the trailing punctuation.
Joseph Mearman created