Commit graph

25238 commits

Author SHA1 Message Date
smit
44c6a54f95
pane: Improve close active item to better handle pinned tabs (#23488)
Closes #22247

- [x] Do not close pinned tab on keyboard shortcuts like `ctrl+w` or
`alt+f4`
- [x] Close pinned tab on context menu action, menu bar action, or vim
bang
- [x] While closing pinned tab via shortcut (where it won't close),
instead activate any other non-pinned tab in same pane
- [x] Else, if any other pane contains non-pinned tab, activate that
- [x] Tests

Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>

Release Notes:

- Pinned tab now stay open when using close shortcuts, auto focuses to
any other non-pinned tab instead.
2025-02-07 22:54:57 +05:30
Bennet Bo Fenner
f0565b4e2e
edit prediction: Do not show icon as disabled when there is no buffer open (#24458)
Release Notes:

- N/A
2025-02-07 17:02:14 +00:00
Conrad Irwin
a6e15dda4b
Make it a bit clearer when people are running dev builds (#24457)
Release Notes:

- Include an indicator in About/CopySystemSpecs when running in debug mode
2025-02-07 09:57:37 -07:00
Finn Evers
144487bf1a
theme: Implement icon theme reloading (#24449)
Closes #24353 

This PR implements icon theme reload to ensure file icons are properly
updated whenever an icon theme extension is upgraded or uninstalled.

Currently, on both upgrade and uninstall of an icon theme extension the
file icons from the previously installed version will stay visibile and
will not be updated as shown in the linked issue. With this change, file
icons will properly be updated on extension upgrade or reinstall.

The code is primarily a copy for reloading the current color theme
adapted to work for icon themes. Happy for any feedback!


Release Notes:

- Fixed file icons not being properly updated upon icon theme upgrade or
uninstall.
2025-02-07 11:30:53 -05:00
Wilhelm Klopp
2d57e43e34
docs: Emphasize that Rust must be installed via rustup (#24447)
Just tried installing a dev extension and kept getting "error: failed to install dev extension".

Turns out this was because I had rust installed via homebrew and not rust. Once I switched to rustup, it worked perfectly fine.

Release Notes:

- N/A
2025-02-07 11:29:45 -05:00
Peter Tripp
c484374b2f
Make OpenKeyContextView open to the right (#24452)
Match the behavior of OpenSyntaxTreeView logs and OpenLanguageServerLogs

Release Notes:

- Make `debug::OpenSyntaxTreeView` automatically open in split to the
right
2025-02-07 11:20:27 -05:00
IaVashik
8114d17cba
google_ai: Add support for Gemini 2.0 models (#24448)
Add support for the newly released Gemini 2.0 models from Google announced this new family of models earlier this week (2025-02-05).

Release Notes:

- Added support for Google's new Gemini 2.0 models.
2025-02-07 11:18:18 -05:00
Sanjeev Shrestha
c7cd5b019b
file_icons: Use separate icon key for JSON files (#24432)
This PR updates the file icon mappings for JSON (`.json`) file map to
the`json` key. Also, updates `.json` icon from `storage` to `code`.

This allows for the JSON file icons to be replaced in icon themes.

Release Notes:

- Icon themes: Added the ability to change the file icon for JSON
(`.json`) files.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-07 16:14:26 +00:00
Marshall Bowers
07929229ae
migrator: Sort dependencies in Cargo.toml (#24455)
This PR sorts the dependencies in the `Cargo.toml` for the `migrator`
crate.

Release Notes:

- N/A
2025-02-07 16:10:07 +00:00
smit
00c2a30059
Migrate keymap and settings + edit predictions rename (#23834)
- [x] snake case keymap properties
- [x] flatten actions
- [x] keymap migration + notfication
- [x] settings migration + notification
- [x] inline completions -> edit predictions 

### future: 
- keymap notification doesn't show up on start up, only on keymap save.
this is existing bug in zed, will be addressed in seperate PR.

Release Notes:

- Added a notification for deprecated settings and keymaps, allowing you
to migrate them with a single click. A backup of your existing keymap
and settings will be created in your home directory.
- Modified some keymap actions and settings for consistency.

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-07 21:17:07 +05:30
Ben Kunkle
a1544f47ad
Fix incorrect assumption about Path.extension() (#24443)
Release Notes:

- N/A
2025-02-07 09:37:07 -06:00
Kirill Bulatov
4f65cfa93d
Fix editor::GoToDiagnostics cycle (#24446)
https://github.com/user-attachments/assets/45f665f0-473a-49bd-b013-b9d1bdb902bd


After activating 2nd diagnostics group, `find_map` code for next
diagnostics did not skip the previous group for the same place.

Release Notes:

- Fixed `editor::GoToDiagnostics` action stuck when multiple diagnostics
groups belong to the same place
2025-02-07 16:49:13 +02:00
Piotr Osiewicz
b6b06cf6d8
lsp: Send DidOpen notifications when changing selections in multi buffer (#22958)
Fixes #22773

Release Notes:

- Fixed an edge case with multibuffers that could break language
features within them.
2025-02-07 12:33:35 +01:00
Michael Sloan
f700268029
Improve vim interactions with edit predictions (#24418)
* When an edit prediction is present in non-insertion modes, hide it but
show `tab Jump to edit`.
* Removes discarding of edit predictions when going from insert mode to
normal mode, instead just hide them in non-insertion modes.
* Removes zeta-specific showing of predictions in normal mode. This
behavior was only happening in special cases anyway - where the discard
of completions wasn't happening due to some other thing taking
precedence in `dismiss_menus_and_popups`.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2025-02-07 03:53:38 -07:00
Michael Sloan
92c21a2814
Fix undismissed app notifications appearing on new workspaces (#24437)
Bug in #23817

Release Notes:

- N/A
2025-02-07 10:29:05 +00:00
Conrad Irwin
1f9d02607b
Fixes to commit button in Git Panel (#24425)
Git Panel updates:

* Fixes commit/commit all button to work (and be disabled correctly in
merge conflict status)
* Updates keyboard shortcuts and sets focus on the button (enter now
does the same as click; tab cycles between editor and change list)


Closes #ISSUE

Release Notes:

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

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2025-02-07 00:21:28 -07:00
smit
6534e0bafd
linux: Fix crash when NoKeymap event is received on Wayland (#24379)
Closes #24139

For weird reasons, Sway on few linux distoros sends `NoKeymap` event when
switching windows. Zed crashes due to assertion on this event to be `XkbV1`.

To fix this, we ignore `NoKeymap` event instead crashing Zed.

Release Notes:

- Fixed a crash in Wayland-based compositors like Sway when switching windows via the keyboard.
2025-02-07 12:31:46 +05:30
Cole Miller
5ffacb9ca5
Revert "Move git status updates to a background thread (#24307)" (#24415)
This reverts commit 980ce5fbf2.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-07 04:46:43 +00:00
Michael Sloan
864c1ff00c
Use commondir from libgit2 instead of walking fs (#22028)
Release Notes:

- N/A
2025-02-07 04:38:09 +00:00
Michael Sloan
35ef269233
Fix build of remote_server when not in git repo (#24424)
Followup to #24258

Release Notes:

- N/A
2025-02-07 04:35:22 +00:00
Cole Miller
d97adfc540
Fix pairs of almost-adjacent hunks toggling together (#24355)
Release Notes:

- Fixed a bug where toggling a diff hunk that immediately precedes
another hunk would act on both hunks
2025-02-07 04:18:59 +00:00
Michael Sloan
a42e040660
Remove use of use_key_equivalents from linux keymap as it does nothing (#24422)
`use_key_equivalents` does nothing on linux, as key equivalents are only
supported on mac. While it could be sensible to anticipate support,
right now it is only used in these few spots, so removing it.

Release Notes:

- N/A
2025-02-07 03:46:15 +00:00
Conrad Irwin
8646d37c0c
vim: Replace with Register (#24326)
Closes #18813

Release Notes:

- vim: Add `gr` for [replace with
register](https://github.com/vim-scripts/ReplaceWithRegister)
2025-02-06 20:24:41 -07:00
Anthony Eid
d83c316e6d
Fix Project Panel select_next_git_entry action (#24217)
## Context

I noticed that the project panel `select_next_git_entry` wasn't behaving
correctly. Turns out it was searching in reverse, which caused the
action to select itself or the last entry.

This PR corrects the behavior and adds a unit test that should stop
regressions.

Note: Since select next/prev git entry uses the same function as select
next/prev diagnostic, the test partially works for that as well.

Release Notes:

- Fix bug where `select_next_git_entry` project panel action would only
select a previous entry or the currently selected entry.

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2025-02-07 03:04:02 +00:00
Jason Lee
c5913899d9
gpui: Fix text-align with nowrap mode (#24116)
Release Notes:

- N/A


------

- Continue #24090 to fix text align for when used `whitespace_nowrap`.
- Fix wrapped line length calculation.

And add example

```
cargo run -p gpui --example text_layout
```

<img width="760" alt="image"
src="https://github.com/user-attachments/assets/a087c300-0e0e-4a80-98c6-90161a9b0905"
/>

---------

Co-authored-by: Owen Law <owenlaw222@gmail.com>
2025-02-06 18:51:00 -08:00
Stanislav Alekseev
e689c8c01b
markdown: Use parsed text (#24388)
Fixes #15463

Release Notes:

- Fixed display of symbols such as `&nbsp;` in hover popovers
2025-02-06 18:37:50 -08:00
Marshall Bowers
888a2df3f0
Sort Cargo.tomls (#24417)
This PR sorts the dependencies in a number of `Cargo.toml` files.

Release Notes:

- N/A
2025-02-07 02:14:57 +00:00
Caleb!
d6d0d7d3e4
Add image dimension and file size information (#21675)
Closes https://github.com/zed-industries/zed/issues/21281

@jansol, kindly take a look when you're free.


![image](https://github.com/user-attachments/assets/da9a54fa-6284-4012-a243-7e355a5290d3)

Release Notes:

- Added dimensions and file size information for images.

---------

Co-authored-by: tims <0xtimsb@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-07 00:56:34 +00:00
Ben Kunkle
a1ed1a00b3
Fix issue with Vim test instead of cheating (#24411)
Appears this test was failing, and someone edited the expected test
output instead of fixing it. Well no longer!

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-06 18:43:30 -06:00
Cole Miller
a190f42ccc
Fix double-lease panic in Repository::activate (#24414)
Release Notes:

- N/A

Co-authored-by: maxbrunsfeld <max@zed.dev>
2025-02-07 00:33:41 +00:00
Cole Miller
59bba2a98c
Assign base text language earlier to fix missing highlighting in deletion hunks (#24413)
Release Notes:

- Fixed deletion diff hunks not being syntax highlighted in some cases

Co-authored-by: Max <max@zed.dev>
2025-02-06 16:14:47 -08:00
Peter Tripp
5315d38cf4
Update extension extraction docs (#24079)
- Fixed a regex for finding tags.
- Templatize the instructions with `$LANGNAME` to prevent manual errors
from failing to edit commands (this bit me)
- Ran formatting through Prettier
2025-02-06 19:01:32 -05:00
Ben Kunkle
337b9e62d2
Fix vim full line operations failing when no trailing newline (#24409)
Closes #24270

Release Notes:

- Fixed an issue where doing line-wise operations in vim mode on the
last line of a file with no trailing newline would not work properly
2025-02-06 17:57:24 -06:00
Cole Miller
73c487c222
Introduce diff crate to unite BufferDiff and BufferChangeSet (#24392)
This is a refactoring PR that does three things:

- First, it introduces a new `diff` crate that holds the previous
contents of the `git::diff` module, plus the `BufferChangeSet` type
formerly of `project::buffer_store`. The new crate is necessary since
simply moving `BufferChangeSet` into `git::diff` results in a dependency
cycle due to the use of `language::Buffer` to represent the diff base in
`BufferChangeSet`.
- Second, it renames the two main types in the new diff crate:
`BufferDiff` becomes `BufferDiffSnapshot`, and `BufferChangeSet` becomes
`BufferDiff`. This reflects that the relationship between these two
types (immutable cheaply-cloneable "value" type + stateful "resource
type" with subscriptions) mirrors existing pairs like
`Buffer`/`BufferSnapshot`. References to "change sets" throughout the
codebase are updated to refer to "diffs" instead.
- Finally, it moves the base_text field of the new BufferDiff type to
BufferDiffSnapshot.

Release Notes:

- N/A

---------

Co-authored-by: maxbrunsfeld <max@zed.dev>
2025-02-06 18:52:32 -05:00
Finn Evers
ffcad71bfa
file_icons: Resolve icon properly for exact file name match (#24396)
Follow-up to #24391 

The current approach has two issues:
- For the described case of `eslint.config.js`, for which a mapping
exists in `suffixes`, this would get mapped from `eslint.config.js` to
`eslint`. However, for `eslint`, there is no mapping within `suffixes`,
thus currently `get_icon_from_suffix` would return `None` and a wrong
item would be returned at a later step.
- Paths passed to this method are relative to the worktree root, thus
e.g. `eslint.config.js` files in subdirectories would still be assigned
the wrong icon.

---

Behaviour on `main`:
<img width="281" alt="main"
src="https://github.com/user-attachments/assets/19b5e5f8-e413-4ac9-a0a1-2c72f810aa86"
/>

Behaviour with this change:
<img width="299" alt="pr"
src="https://github.com/user-attachments/assets/eec70cbd-df39-49b4-8b07-d22afa949781"
/>

CC @probably-neb 

Release Notes:

- N/A
2025-02-06 17:14:39 -06:00
Marshall Bowers
3ab48b31a1
image_viewer: Fix cargo test errors (#24404)
This PR fixes the errors when running `cargo test` in the `image_viewer`
crate.

Release Notes:

- N/A
2025-02-06 22:38:35 +00:00
Nate Butler
00971fbe41
Introduce KeybindingHint (#24397)
- Implements scaling for `ui::Keybinding` and it's component parts
- Adds the `ui::KeybindingHint` component for creating keybinding hints
easily:

![CleanShot 2025-02-04 at 16 59
38@2x](https://github.com/user-attachments/assets/d781e401-8875-4edc-a4b0-5f8750777d86)

Release Notes:

- N/A
2025-02-06 21:45:03 +00:00
Ben Kunkle
9c132fece5
Fix #24314 - File icons missing for hidden files (#24391)
- **fix ignoring ignored files when matching icons**
- **remove poorly named and confusing method
`PathExt.icon_stem_or_suffix` and refactor
`PathExt.extension_or_hidden_file_name` to actually do what it says it
does**

Closes #24314

Release Notes:

- Fixed an issue where hidden files would have the default icon instead
of the correct one
- Fixed an issue where files with specific icons (such as
`eslint.config.js`) would not have the their specific icon without a
leading `.` (`.eslint.config.js`)
2025-02-06 14:26:42 -06:00
Danilo Leal
ad46c5b567
edit prediction: Improve the onboarding modal (#24386) 2025-02-06 19:58:53 +00:00
Danilo Leal
c28c767b40
edit prediction: Wordsmith status bar menu docs aside (#24390)
Refining writing in the status bar menu docs aside.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
2025-02-06 19:49:13 +00:00
Agus Zubiaga
e1bb9570df
edit predictions: Reset onboarding action (#24387)
https://github.com/user-attachments/assets/bb597b93-a616-4f8a-8608-013b8202799c


Release Notes:

- N/A
2025-02-06 19:07:27 +00:00
Marshall Bowers
09967ac3d0
zeta: Send up diagnostics with prediction requests (#24384)
This PR makes it so we send up the diagnostic groups as additional data
with the edit prediction request.

We're not yet making use of them, but we are recording them so we can
use them later (e.g., to train the model).

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2025-02-06 18:07:26 +00:00
Agus Zubiaga
13089d7ec6
edit predictions: Polish up ⌥ preview experience (#24380)
- Do not accept with just `tab` in `when_holding_modifer` mode
- Fix fake cursor for jumps when destination row is outside viewport
- Use current preview state for deciding whether to show modifiers in
popovers
- Stay in preview state if ⌥ isn't released after accepting a jump

Release Notes:

- N/A
2025-02-06 16:13:21 +00:00
0x2CA
c24f22cd14
vim: Fix Around Subword not including whitespace (#24356)
Closes #24271

Release Notes:

- Fixed Around Subword No Include Whitespace
2025-02-06 08:54:04 -07:00
Marshall Bowers
8fc5d227a4
copilot: Sort dev dependencies in Cargo.toml (#24378)
This PR sorts the dev dependencies in `copilot`'s `Cargo.toml`.

Release Notes:

- N/A
2025-02-06 15:19:03 +00:00
Cole Miller
01bcbf3b0d
Fix missing diff hunks in single-file worktrees (#24377)
Release Notes:

- Fixed diff hunks not appearing when opening a single file within a
larger repository
2025-02-06 10:13:56 -05:00
Danilo Leal
592642fbfc
edit predictions: Tweak status bar menu copywriting (#24376)
Just fine-tuning words on items of the status bar menu.

Release Notes:

- N/A
2025-02-06 11:28:25 -03:00
Danilo Leal
35886e38e5
edit prediction: Add minor UI tweaks to the preview bar (#24174)
Just little nudges of spacing, alignment, and treatment for overflowing
content.

Release Notes:

- N/A
2025-02-06 11:00:09 -03:00
Agus Zubiaga
8ed8b4d2ec
edit predictions: Preview while holding modifier mode (#24316)
This PR adds a new `inline_completions.inline_preview` config which can
be set to `auto` (current behavior) or to `when_holding_modifier`.
When set to the latter, instead of showing edit prediction previews
inline in the buffer, we'll show it in a popover (even when there's no
LSP completion) so your isn't constantly moving as completions arrive.


https://github.com/user-attachments/assets/3615d151-3633-4ee4-98b9-66ee0aa735b8

Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
2025-02-06 09:58:19 -03:00
Kirill Bulatov
b4d8b1be3f
Preserve Wrangler logs during docs deployment CI runs (#24371)
Adds a log collection step to debug errors like
https://github.com/zed-industries/zed/actions/runs/13175284280/job/36773129216#step:8:29

During testing though, the CI had passed, so 500 seems to be unrelated
to Zed changes:
https://github.com/zed-industries/zed/actions/runs/13175800537/job/36774702686

Release Notes:

- N/A
2025-02-06 10:12:22 +00:00