Commit Graph

2044 Commits

Author SHA1 Message Date
Conrad Irwin
41c8f2caa6
Attempt to fix segfault in window drop (#10690)
By default NSWindow's release themselves when closed, which doesn't
interact well with rust's lifetime system.

Disable that behaviour, and explicitly release the NSWindow when the
window handle is dropped.

Release Notes:

- Fixed a (rare) panic when closing a window.
2024-04-17 15:29:10 -06:00
Kyle Kelley
f5c2483423
Close the backticks in gpui geometry examples (#10579)
I noticed some of the examples in `crates/gpui/src/geometry.rs` were
missing ending triple backticks.

Release Notes:

- N/A
2024-04-15 16:52:19 -07:00
apricotbucket28
3eb8464d19
wayland: Improve cursor (#10516)
Fixes the cursor not updating when (a) switching windows from another
program via a shortcut and (b) when cursor updates were triggered by
something other than moving the mouse (e.g. when scrolling or pressing a
key).

Release Notes:

- N/A
2024-04-15 12:09:24 -07:00
张小白
58f57491b1
windows: Remove last_ime_input (#10506)
It seems that windows always report IME composition string, so there is
no need to store this string manually.

Release Notes:

- N/A
2024-04-15 12:08:38 -07:00
Antonio Scandurra
200e36311c
Intersect content mask with hitbox bounds only during hit test (#10554)
This fixes a bug that caused the editor to be rendered incorrectly when
its bounds extended outside the content mask. This is because the editor
uses the returned `Hitbox` bounds to determine the origin of its
elements.

With this commit, we will now store a new `content_mask` field within
the `Hitbox` struct which is captured when the hitbox is inserted. Then,
the content mask is applied on the fly when performing a hit test to
determine whether the hitbox is actually hovered.

Release Notes:

- N/A
2024-04-15 15:09:15 +02:00
apricotbucket28
556ecd94c2
blade: Fix incorrect texture format (#10524)
Fixes image rendering
Closes https://github.com/zed-industries/zed/issues/10505

Before:

![image](https://github.com/zed-industries/zed/assets/71973804/3a903279-d631-4ca6-9f46-3065c7ed3073)


After:

![image](https://github.com/zed-industries/zed/assets/71973804/ab3a73e5-bf21-4df7-a9c1-a74bd1993a5b)


Release Notes:

- N/A
2024-04-14 11:46:31 -07:00
Mikayla Maki
3289188e0a
linux: Simplify scrolling implementation (#10497)
This PR adjusts our scrolling implementation to delay the generation of
ScrollWheel events until we receive a complete frame.

Note that our implementation is still a bit off-spec, as we don't delay
any other kind of events. But it's been working so far on a variety of
compositors and the other events contain complete data; so I'll hold off
on that refactor for now.

Release Notes:

- N/A
2024-04-12 15:54:11 -07:00
Conrad Irwin
e64ecdc9ab
Add missing block.copy() (#10496)
https://crates.io/crates/block implies this is necessary, and we're
still seeing segfaults in this method, so...

Release Notes:

- Fixed a panic when installing the CLI / registering for the zed://
protocol
2024-04-12 14:50:12 -06:00
Conrad Irwin
ba9c5929af
Fix emojis when rendering with the system ui font (#10491)
Release Notes:

- N/A
2024-04-12 14:05:01 -06:00
usr
cb6d0639db
Windows: Fix crash when trying to copy nothing to clipboard (#10405)
Release Notes:

- N/A
2024-04-12 12:33:20 -07:00
张小白
104558115f
windows: Update WindowsDisplay::frequency() (#10476)
A subsequent update introduced the `HMONITOR` value to the
`WindowsDisplay` struct, eliminating the need for polling to retrieve
this value.

Release Notes:

- N/A
2024-04-12 12:19:49 -07:00
Kyle Kelley
49371b44cb
Semantic Index (#10329)
This introduces semantic indexing in Zed based on chunking text from
files in the developer's workspace and creating vector embeddings using
an embedding model. As part of this, we've created an embeddings
provider trait that allows us to work with OpenAI, a local Ollama model,
or a Zed hosted embedding.

The semantic index is built by breaking down text for known
(programming) languages into manageable chunks that are smaller than the
max token size. Each chunk is then fed to a language model to create a
high dimensional vector which is then normalized to a unit vector to
allow fast comparison with other vectors with a simple dot product.
Alongside the vector, we store the path of the file and the range within
the document where the vector was sourced from.

Zed will soon grok contextual similarity across different text snippets,
allowing for natural language search beyond keyword matching. This is
being put together both for human-based search as well as providing
results to Large Language Models to allow them to refine how they help
developers.

Remaining todo:

* [x] Change `provider` to `model` within the zed hosted embeddings
database (as its currently a combo of the provider and the model in one
name)


Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Conrad Irwin <conrad@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
2024-04-12 11:40:59 -06:00
Maxime Forveille
4b40e83b8b
gpui: Fix window title special characters display on X11 (#9994)
Before:

![image](https://github.com/zed-industries/zed/assets/13511978/f12a144a-5c41-44e9-8422-aa73ea54fb9c)

After:

![image](https://github.com/zed-industries/zed/assets/13511978/45e9b701-77a8-4e63-9481-dab895a347f7)

Release Notes:

- Fixed window title special characters display on X11.

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-04-12 09:49:31 -07:00
张小白
04e89c4c51
Use workspace uuid (#10475)
Release Notes:

- N/A
2024-04-12 10:53:10 -04:00
Thorsten Ball
6e1ba7e936
Allow hovering over tooltips in git blame sidebar (#10466)
This introduces a new API on `StatefulInteractiveElement` to create a
tooltip that can be hovered, scrolled inside, and clicked:
`.hoverable_tooltip`.

Right now we only use it in the `git blame` gutter, but the plan is to
use the new hover/click/scroll behavior in #10398 to introduce new
git-blame-tooltips.

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-04-12 11:47:32 +02:00
Conrad Irwin
08786fa7bf
Make BufferSearch less wide (#10459)
This also adds some "responsiveness" so that UI elements are hidden
before everything has to be occluded

Release Notes:

- Improved search UI. It now works in narrower panes, and avoids
scrolling the editor on open.

<img width="899" alt="Screenshot 2024-04-11 at 21 33 17"
src="https://github.com/zed-industries/zed/assets/94272/44b95d4f-08d6-4c40-a175-0e594402ca01">
<img width="508" alt="Screenshot 2024-04-11 at 21 33 45"
src="https://github.com/zed-industries/zed/assets/94272/baf4638d-427b-43e6-ad67-13d43f0f18a2">
<img width="361" alt="Screenshot 2024-04-11 at 21 34 00"
src="https://github.com/zed-industries/zed/assets/94272/ff60b561-2f77-49c0-9df7-e26227fe9225">
<img width="348" alt="Screenshot 2024-04-11 at 21 37 03"
src="https://github.com/zed-industries/zed/assets/94272/a2a700a2-ce99-41bd-bf47-9b14d7082b0e">
2024-04-11 23:07:29 -06:00
CharlesChen0823
3ab9700155
Windows: Add missing delete key (#10422)
Add miss delete key in windows platform.
Release Notes:

- N/A
2024-04-11 16:20:28 -07:00
Mikayla Maki
9d96ae6e78
Redo linux state again (#10452)
With the recent Linux rewrite, I attempted to simplify the number of
wrapper structs involved in the Linux code, following the macOS code as
an example. Unfortunately, I missed a vital component: pointers to the
platform state, held by platform data structures. As we hold all of the
platform data structures on Linux, this PR reintroduces a wrapper around
the internal state of both the platform and the window. This allows us
to close and drop windows correctly.

This PR also fixes a performance problem introduced by:
https://github.com/zed-industries/zed/pull/10343, where each configure
request would add a new frame callback quickly saturating the main
thread and slowing everything down.

Release Notes:
- N/A
2024-04-11 16:12:14 -07:00
Conrad Irwin
f6c85b28d5
WIP: remoting (#10085)
Release Notes:

- Added private alpha support for remote development. Please reach out to hi@zed.dev if you'd like to be part of shaping this feature.
2024-04-11 15:36:35 -06:00
Bennet Bo Fenner
ea4419076e
Add preview tabs (#9125)
This PR implements the preview tabs feature from VSCode.
More details and thanks for the head start of the implementation here
#6782.

Here is what I have observed from using the vscode implementation ([x]
-> already implemented):
- [x] Single click on project file opens tab as preview
- [x] Double click on item in project panel opens tab as permanent
- [x] Double click on the tab makes it permanent
- [x] Navigating away from the tab makes the tab permanent and the new
tab is shown as preview (e.g. GoToReference)
- [x] Existing preview tab is reused when opening a new tab
- [x] Dragging tab to the same/another panel makes the tab permanent
- [x] Opening a tab from the file finder makes the tab permanent
- [x] Editing a preview tab will make the tab permanent
- [x] Using the space key in the project panel opens the tab as preview
- [x] Handle navigation history correctly (restore a preview tab as
preview as well)
- [x] Restore preview tabs after restarting
- [x] Support opening files from file finder in preview mode (vscode:
"Enable Preview From Quick Open")
 
I need to do some more testing of the vscode implementation, there might
be other behaviors/workflows which im not aware of that open an item as
preview/make them permanent.

Showcase:


https://github.com/zed-industries/zed/assets/53836821/9be16515-c740-4905-bea1-88871112ef86


TODOs
- [x] Provide `enable_preview_tabs` setting
- [x] Write some tests
- [x] How should we handle this in collaboration mode (have not tested
the behavior so far)
- [x] Keyboard driven usage (probably need workspace commands)
- [x] Register `TogglePreviewTab` only when setting enabled?
- [x] Render preview tabs in tab switcher as italic
- [x] Render preview tabs in image viewer as italic
- [x] Should this be enabled by default (it is the default behavior in
VSCode)?
- [x] Docs

Future improvements (out of scope for now):
- Support preview mode for find all references and possibly other
multibuffers (VSCode: "Enable Preview From Code Navigation")


Release Notes:

- Added preview tabs
([#4922](https://github.com/zed-industries/zed/issues/4922)).

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-04-11 23:09:12 +02:00
Piotr Osiewicz
ea165e134d
gpui-macros: Hide autogenerated action types/functions (#10417)
I've found it a bit annoying that autogenerated code shows up in
completions when working on Zed, so I've moved them into an associated
function of a struct we're "implementing" Action on. That way, neither a
generated function nor a static show up in completions.

Note that this change only affects Zed codebase! I'm pushing it up right
after last Preview to give it some time on Nightly.
Before:

![image](https://github.com/zed-industries/zed/assets/24362066/7343201f-f05b-4342-a9f7-97f002d88a48)

![image](https://github.com/zed-industries/zed/assets/24362066/e67f9dcb-e090-40e0-873c-e51bd39e0c7e)

After:

![image](https://github.com/zed-industries/zed/assets/24362066/0704211a-73f5-4f12-8583-9e47f092e5b7)

![image](https://github.com/zed-industries/zed/assets/24362066/c6fa00f5-fd8f-4f06-8be7-b74acedccd7c)


Release Notes:

- N/A
2024-04-11 15:38:47 +02:00
Joseph T. Lyons
eb6f7c1240
Remove if-not-else patterns (#10402) 2024-04-11 03:48:06 -04:00
Conrad Irwin
3b68665277
Update resvg to fix panic (#10393)
This bumps us up a *long* way on the resvg/usvg crate, to fix a panic

Release Notes:

- Fixed a panic when rendering certain malformed SVGs
2024-04-10 20:12:05 -06:00
Joel Selvaraj
322f68f3d6
linux: wayland: fix cursor set_icon (#10374)
Release Notes:

- Partially (Wayland implementation) Fixed
[#10124](https://github.com/zed-industries/zed/issues/10124)).

The recent refactor of the linux gpui implementation
(https://github.com/zed-industries/zed/pull/10227) broke the wayland
cursor update logic by setting the cursor icon as `None`. Fix it by
setting the `cursor_icon_name`.
2024-04-10 12:59:33 -07:00
张小白
fdddbfc179
Fix caret movement issue for some special characters (#10198)
Currently in Zed, certain characters require pressing the key twice to
move the caret through that character. For example: "❤️" and "y̆".

The reason for this is as follows:

Currently, Zed uses `chars` to distinguish different characters, and
calling `chars` on `y̆` will yield two `char` values: `y` and `\u{306}`,
and calling `chars` on `❤️` will yield two `char` values: `❤` and
`\u{fe0f}`.

Therefore, consider the following scenario (where ^ represents the
caret):

- what we see: ❤️ ^
- the actual buffer: ❤ \u{fe0f} ^

After pressing the left arrow key once:

- what we see: ❤️ ^
- the actual buffer: ❤ ^ \u{fe0f}

After pressing the left arrow key again:
- what we see: ^ ❤️
- the actual buffer: ^ ❤ \u{fe0f}

Thus, two left arrow key presses are needed to move the caret, and this
PR fixes this bug (or this is actually a feature?).

I have tried to keep the scope of code modifications as minimal as
possible. In this PR, Zed handles such characters as follows:

- what we see: ❤️ ^
- the actual buffer: ❤ \u{fe0f} ^

After pressing the left arrow key once:

- what we see: ^ ❤️
- the actual buffer: ^ ❤ \u{fe0f}

Or after pressing the delete key:

- what we see: ^
- the actual buffer: ^

Please note that currently, different platforms and software handle
these special characters differently, and even the same software may
handle these characters differently in different situations. For
example, in my testing on Chrome on macOS, GitHub treats `y̆` as a
single character, just like in this PR; however, in Rust Playground,
`y̆` is treated as two characters, and pressing the delete key does not
delete the entire `y̆` character, but instead deletes `\u{306}` to yield
the character `y`. And they both treat `❤️` as a single character,
pressing the delete key will delete the entire `❤️` character.

This PR is based on the principle of making changes with the smallest
impact on the code, and I think that deleting the entire character with
the delete key is more intuitive.

Release Notes:

- Fix caret movement issue for some special characters

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-04-10 13:01:25 -06:00
Nathan Sobo
7abb63cfda
Improve the ergonomics of creating local buffers (#10347)
This PR renames `language::Buffer::new` to `language::Buffer::local` and
simplifies its interface. Instead of taking a replica id (which should
always be 0 for the local case) and a `BufferId`, which was awkward and
verbose to construct, it simply takes text and a `cx`.

It uses the `cx` to derive a `BufferId` from the `EntityId` associated
with the `cx`, which should always be positive based on the following
analysis...

We convert the entity id to a u64 using this method on `EntityId`, which
is defined by macros in the `slotmap` crate:

```rust
    pub fn as_ffi(self) -> u64 {
        (u64::from(self.version.get()) << 32) | u64::from(self.idx)
    }
```

If you look at the type of `version` in `KeyData`, it is non-zero:

```rust
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KeyData {
    idx: u32,
    version: NonZeroU32,
}
```

This commit also adds `Context::reserve_model` and
`Context::insert_model` to determine a model's entity ID before it is
created, which we need in order to assign a `BufferId` in the background
when loading a buffer asynchronously.

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-04-10 08:32:51 -06:00
Kamal Ahmad
4151ba13a1
X11: Don't emit keypress events for modifiers (#10271)
This fixes certain shortcuts/motions on X11 like in vim mode "v i )",
where previously zed would interpret it as "v i SHIFT )" due to the x11
backend emitting key press events for modifier keys even though other
platforms like Wayland don't. This also adds support for
ModifiersChanged events to X11

Release Notes:

- Fixed vim motions like "v i )" not working on X11
([#10199](https://github.com/zed-industries/zed/issues/10199)).
2024-04-09 18:46:23 -07:00
CharlesChen0823
6ac343123d
Windows: Fix render resource not being released (#10233)
Release Notes:
- N/A
2024-04-09 18:46:09 -07:00
张小白
c763c8c64b
windows: Implement restart action (#10234)
Release Notes:

- N/A
2024-04-09 18:35:10 -07:00
Ezekiel Warren
bfd9bb8a7c
Use shared text system on Linux and Windows (#10098)
closes #10129
closes #10269

Release Notes:

- N/A
2024-04-09 17:25:16 -07:00
Dzmitry Malyshau
8f69eac402
Update blade to a version that can run GLES for Zed (#10243)
Release Notes:
- N/A

Picks up https://github.com/kvark/blade/pull/105,
https://github.com/kvark/blade/pull/97, and more

Switches the presentation to be non-blocking, which will improve the
latency slightly.

Allows to start playing with GLES backend, e.g.
```bash
cd crates/gpui
RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo run --example hello_world
```

It doesn't currently render properly due to an issue that needs
investigation, see
https://github.com/kvark/blade/pull/105#issuecomment-2041006542
But at least it's a start

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-04-09 17:16:35 -07:00
Mikayla Maki
3fc08a0610
Fix a bug from the Linux rewrite where Wayland windows would not render properly (#10343)
Release Notes:

- N/A
2024-04-09 17:16:09 -07:00
Max Brunsfeld
6b320b9efe
Fix cleanup of LSP request status messages (#10336)
This fixes a bug in https://github.com/zed-industries/zed/pull/9818,
where the status was not removed if the request failed. It also adds
replication of these new status messages to guests when collaborating.

Release Notes:

- Fixed an issue where the status of failed LSP actions was left in the
status bar

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-04-09 17:34:51 -04:00
Nathan Sobo
414058379b
Switch to the system UI font on macOS (#10317)
To reference the system font, use the special ".SystemUIFont" family
name.

/cc @PixelJanitor 

Release Notes:

- Switched to the system UI  font for user interface elements on macOS.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-04-09 07:44:57 -06:00
Piotr Osiewicz
4fb9f41e69
gpui/metal: Clamp max texture width/height to 16kB (#10314)
Fixed #10149
A user had Zed crash due to invalid font size in settings. It turned out
the width/height of glyphs does not pass validation in Metal texture
initialization with a large enough font size.

All modern Macs have a max texture width/height of 16kB (barring Apple
A8, used by iPhone 6 back in 2014, which uses 8kB). This commit clamps
texture size at 16kB. Note that while it fixes Zed crash, using a font
size that hits the limit is still pretty unusable - the users will still
have a pretty unusable editor, but at least it won't crash for them.



Release Notes:

- Fixed crashes with huge `buffer_font_size` values.
2024-04-09 14:09:09 +02:00
Mikayla Maki
def87a8d76
WIP: Refactor Linux platform implementation (#10227)
This puts the Linux platform implementation at a similar code style and
quality to the macOS platform. The largest change is that I collapsed
the `LinuxPlatform` -> `[Backend]` -> `[Backend]State` ->
`[Backend]StateInner` to just `[Backend]` and `[Backend]State`, and in
the process removed most of the `Rc`s and `RefCell`s.

TODO:
- [x] Make sure that this is on-par with the existing implementation
- [x] Review in detail, now that the large changes are done.
- [ ] Update the roadmap

Release Notes:

- N/A
2024-04-08 16:40:35 -07:00
Hans
0390df27d4
Fix block cursor does not render italic for vim (#10249)
Release Notes:

- Fixed #8799
2024-04-08 14:50:50 -06:00
Conrad Irwin
9b88259b1f
Fix panic in drag entered (#10277)
Co-Authored-By: Kirill <kirill@zed.dev>

Release Notes:

- Fixed panic when dragging into Zed.

Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.

**or**

- N/A

Co-authored-by: Kirill <kirill@zed.dev>
2024-04-08 11:18:10 -06:00
Kyle Kelley
c7961b9054
Implement ObjectFit::ScaleDown for images (#10063)
While working towards fixes for the image viewer, @mikayla-maki and I
discovered that we didn't have `object-fit: scale-down` implemented.
This doesn't _fully_ solve the image issues as there is some issue where
only the bounds width is updating on layout change that I haven't fully
chased down.

Co-Authored-By: @mikayla-maki 

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-04-06 15:20:30 -07:00
Thorsten Ball
3a0d3cee87
Compute scrollbar markers asynchronously (#10080)
Refs #9647
Fixes https://github.com/zed-industries/zed/issues/9792

This pull request moves the computation of scrollbar markers off the
main thread, to prevent them from grinding the editor to a halt when we
have a lot of them (e.g., when there are lots of search results on a
large file). With these changes we also avoid generating multiple quads
for adjacent markers, thus fixing an issue where we stop drawing other
primitives because we've drawn too many quads in the scrollbar.

Release Notes:

- Improved editor performance when displaying lots of search results,
diagnostics, or symbol highlights in the scrollbar
([#9792](https://github.com/zed-industries/zed/issues/9792)).

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan <nathan@zed.dev>
2024-04-03 12:21:17 +02:00
Conrad Irwin
fe7b12c444
fix rejoin after quit (#10100)
Release Notes:

- collab: Fixed rejoining channels quickly after a restart
2024-04-02 20:35:14 -06:00
Conrad Irwin
9317fe46af Revert "Revert "Revert dependency updates in #9836 (#10089)""
This reverts commit c8b14ee2cb.
2024-04-02 13:12:38 -06:00
Conrad Irwin
c8b14ee2cb Revert "Revert dependency updates in #9836 (#10089)"
This reverts commit 55c897d993.
2024-04-02 12:59:10 -06:00
Mikayla Maki
55c897d993
Revert dependency updates in #9836 (#10089)
Due to: https://github.com/zed-industries/zed/issues/9985 and an
abundance of caution, I'm reverting the image and svg rendering updates
for now until we can debug the issue. cc: @niklaswimmer

Release Notes:

- N/A
2024-04-02 12:27:48 -06:00
Max Brunsfeld
46544d7354
Revert PR #8327 - Fix autocomplete completions being cut in half (#10084)
This reverts https://github.com/zed-industries/zed/pull/8327

That PR introduced a regression where completions' syntax highlighting
would be corrupted in a non-deterministic way, such that it varied from
frame to frame:

In the screenshot below, many of the field names (e.g. `cursor`,
`depth`) are incorrectly colored as types instead of fields. The
`finished_states` field has highlighting that changes at the wrong
offset. All of these values changed from frame to frame, creating a
strange flickering effect:

<img width="599" alt="Screenshot 2024-04-01 at 5 56 36 PM"
src="https://github.com/zed-industries/zed/assets/326587/b6a48f02-f146-4f76-92e6-32fb417d86c0">

Release Notes:

- N/A
2024-04-02 09:24:55 -07:00
Thorsten Ball
ad03a7e72c
Remove tooltips on scroll wheel events (#10069)
This fixes #9928 by invalidating the tooltip on mouse scroll.

I think _ideally_ we'd have a solution that only invalidates it if,
after mouse scroll, we're not hovering over the element. But I tried
that (by essentially duplicating the code for `MouseMoveEvent` but that
lead to some inconsistencies. I think we don't redraw when we finish
scrolling.

This now behaves exactly like tooltips in Chrome: invalidate on scroll,
move mouse again to trigger the tooltip.

It also behaves like the hover tooltips in the editor.


https://github.com/zed-industries/zed/assets/1185253/05b9170e-414c-4453-84e5-90510b943c15


Release Notes:

- N/A
2024-04-02 14:10:51 +02:00
Mikayla Maki
1da2441e7b
Fix assorted linux issues (#10061)
- Fix a bug where modifiers would be dispatched before they changed
- Add a secondary modifier
- Improve keybindings

Release Notes:

- N/A
2024-04-01 17:22:59 -07:00
Marshall Bowers
f19e84dc22
Fix doc comments for StyledText (#10058)
This PR fixes some doc comments for `StyledText` to better reflect Rust
doc comment conventions.

Release Notes:

- N/A
2024-04-01 19:25:17 -04:00
Ephram
6e49a2460e
Fix autocomplete completions being cut in half (#8327)
Release Notes:

- Fixed LSP completions being cut in half
([#8126](https://github.com/zed-industries/zed/issues/8126)).

Previously, autocomplete suggestions were covered by autocomplete
documentation, which only appeared after a short delay.

Now, when an autocomplete suggestion is too long to fit, the name is
truncated with ellipses like how VSCode does it:

![image](https://github.com/zed-industries/zed/assets/50590465/bf3c6271-7d7a-44b1-ab76-647df5620fcd)

Additionally `completion_documentation_secondary_query_debounce`'s
default was changed from 300ms to 0ms, which makes the editor feel
significantly faster (in my opinion).

Before:


https://github.com/zed-industries/zed/assets/50590465/6443670b-fe25-4428-9a39-54405d9a7cec

After:


https://github.com/zed-industries/zed/assets/50590465/72572487-3eb4-4a96-a2f9-608e563a1f05

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-04-01 13:20:51 -06:00
apricotbucket28
d1d4f83722
Revert "Fix key repeat after releasing a different key on Wayland" (#10039)
Reverts zed-industries/zed#9768

That change didn't seem necessary and it made symbols that need a key
shortcut to be written (e.g. SHIFT + 2 for a quote) infinitely repeat.
 
Release Notes:

- N/A
2024-04-01 11:43:52 -07:00
Marshall Bowers
65840b3633
Hoist profile.dev.package setting to workspace-level (#10041)
This PR hoists the `profile.dev.package` settings for compiling the
`resvg` crate with optimizations up to the workspace level, since Cargo
was complaining:

```
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/maxdeviant/projects/zed/crates/gpui/Cargo.toml
workspace: /Users/maxdeviant/projects/zed/Cargo.toml
```

Release Notes:

- N/A
2024-04-01 11:56:17 -04:00
Bennet Bo Fenner
c126fdb616
Fix panel drag leaking through overlay (#10035)
Closes #10017. While reworking the `overlay` element in #9911, I did not
realize that all overlay elements called `defer_draw` with a priority of
`1`.

/cc @as-cii 

Not including release notes, since it was only present in nightly.

Release Notes:

- N/A
2024-04-01 12:31:19 +02:00
Matthias Grandl
b1ccead0f6
gpui: fix #9931 img object-fit regression (#10006)
PR: #9931 broke image scaling, such that it ignores the object-fit
parameter and instead always scales the image to fit the bounds. This
fixes the regression.
2024-03-31 08:17:09 -07:00
Petros Amoiridis
3c8b376764
Fix broken character (#9992)
This is extremely minor but I couldn't help it.


![broken-character](https://github.com/zed-industries/zed/assets/28818/1b598b53-2a6a-4fd7-8857-a43e682db35e)

Release Notes:

- N/A
2024-03-30 14:39:45 -04:00
Matthias Grandl
f9becbd3d1
gpui: Add SVG rendering to img element and generic asset cache (#9931)
This is a follow up to #9436 . It has a cleaner API and generalized the
image_cache to be a generic asset cache, that all GPUI elements can make
use off. The changes have been discussed with @mikayla-maki on Discord.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-29 17:09:49 -07:00
Daniel Zhu
30193647f3
Fix Recent Documents List (continues #8952) (#9919)
@SomeoneToIgnore This code should 100% work for future Zed users, but
for current Zed users, Zed's internal list of recents may not be synced
w/ macOS' Recent Documents at first. If needed this can be fixed by
calling `cx.refresh_recent_documents` on startup, but that feels a bit
unnecessary.

Release Notes:

- Fixes behavior of Recent Documents list on macOS
2024-03-29 23:17:25 +02:00
Marshall Bowers
16e6f5643c
Extract SemanticVersion into its own crate (#9956)
This PR extracts the `SemanticVersion` out of `util` and into its own
`SemanticVersion` crate.

This allows for making use of `SemanticVersion` without needing to pull
in some of the heavier dependencies included in the `util` crate.

As part of this the public API for `SemanticVersion` has been tidied up
a bit.

Release Notes:

- N/A
2024-03-29 12:11:57 -04:00
Bennet Bo Fenner
77f1cc95b8
gpui: Rework overlay element (#9911)
There was a problem using deferred draws with `overlay` and tooltips at
the same time.

The `overlay` element was removed and was split up into two separate
elements
- `deferred`
- `anchored` - Mimics the `overlay` behavior but does not render its
children as deferred

`tooltip_container` does not defer its drawing anymore and only uses
`anchored`.

/cc @as-cii 


Release Notes:
- Fixed tooltip for the recent projects popover not showing anymore

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-03-29 16:26:16 +01:00
jansol
49144d94bf
gpui: Add support for window transparency & blur on macOS (#9610)
This PR adds support for transparent and blurred window backgrounds on
macOS.

Release Notes:

- Added support for transparent and blurred window backgrounds on macOS
([#5040](https://github.com/zed-industries/zed/issues/5040)).
- This requires themes to specify a new `background.appearance` key
("opaque", "transparent" or "blurred") and to include an alpha value in
colors that should be transparent.

<img width="913" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/7547ee2a-e376-4d55-9114-e6fc2f5110bc">
<img width="994" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/b36fbc14-6e4d-4140-9448-69cad803c45a">
<img width="1020" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/d70e2005-54fd-4991-a211-ed484ccf26ef">

---------

Co-authored-by: Luiz Marcondes <luizgustavodevergennes@gmail.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-29 11:10:47 -04:00
Thorsten Ball
7f54935324
Add git blame (#8889)
This adds a new action to the editor: `editor: toggle git blame`. When
used it turns on a sidebar containing `git blame` information for the
currently open buffer.

The git blame information is updated when the buffer changes. It handles
additions, deletions, modifications, changes to the underlying git data
(new commits, changed commits, ...), file saves. It also handles folding
and wrapping lines correctly.

When the user hovers over a commit, a tooltip displays information for
the commit that introduced the line. If the repository has a remote with
the name `origin` configured, then clicking on a blame entry opens the
permalink to the commit on the code host.

Users can right-click on a blame entry to get a context menu which
allows them to copy the SHA of the commit.

The feature also works on shared projects, e.g. when collaborating a
peer can request `git blame` data.

As of this PR, Zed now comes bundled with a `git` binary so that users
don't have to have `git` installed locally to use this feature.

### Screenshots

![screenshot-2024-03-28-13 57
43@2x](https://github.com/zed-industries/zed/assets/1185253/ee8ec55d-3b5e-4d63-a85a-852da914f5ba)

![screenshot-2024-03-28-14 01
23@2x](https://github.com/zed-industries/zed/assets/1185253/2ba8efd7-e887-4076-a87a-587a732b9e9a)
![screenshot-2024-03-28-14 01
32@2x](https://github.com/zed-industries/zed/assets/1185253/496f4a06-b189-4881-b427-2289ae6e6075)

### TODOs

- [x] Bundling `git` binary

### Release Notes

Release Notes:

- Added `editor: toggle git blame` command that toggles a sidebar with
git blame information for the current buffer.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-28 18:32:11 +01:00
Niklas Wimmer
e2d6b0deba
gpui: Update dependencies (second attempt) (#9836)
Updated version of #9741 with fixes for the problems raised in #9774. I
only verified that the images no longer look blueish on Linux, because I
don't have a Mac.

cc @osiewicz

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-28 10:22:31 -07:00
白山風露
94c51c6ac9
Windows: Enable clippy deny warnings (#9920)
~Waiting #9918~

Release Notes:

- N/A
2024-03-28 11:55:35 -04:00
Mikayla Maki
9bce5e8b82
Improve diagnostic header UI (#9888)
This PR rearranges the diagnostics to put the headers to the left of the
diagnostic messages and adds an additional button to close the
diagnostics.

<img width="394" alt="Screenshot 2024-03-27 at 2 01 19 PM"
src="https://github.com/zed-industries/zed/assets/2280405/83be4051-6441-47c6-9b48-77c75ce9c8eb">

<img width="326" alt="Screenshot 2024-03-27 at 2 01 56 PM"
src="https://github.com/zed-industries/zed/assets/2280405/d849ca34-91e9-4de6-9d9c-503b75e97d60">

As a drive by, I also quieted a useless but loud log message.

Release Notes:

- Added a close button to the `f8` diagnostics.
2024-03-27 14:30:27 -07:00
Bennet Bo Fenner
e272acd1bc
collab ui: Fix notification windows on external monitors (#9817)
Sharing a project displays a notification (window) on every screen.
Previously there was an issue with the positioning of windows on all
screens except the primary screen.

As you can see here:


![image](https://github.com/zed-industries/zed/assets/53836821/314cf367-8c70-4e8e-bc4a-dcbb99cb4f71)

Now:


![image](https://github.com/zed-industries/zed/assets/53836821/42af9ef3-8af9-453a-ad95-147b5f9d90ba)

@mikayla-maki and I also decided to refactor the `WindowOptions` a bit. 
Previously you could specify bounds which controlled the positioning and
size of the window in the global coordinate space, while also providing
a display id (which screen to show the window on). This can lead to
unusual behavior because you could theoretically specify a global bound
which does not even belong to the display id which was provided.

Therefore we changed the api to this:
```rust
struct WindowOptions {
    /// The bounds of the window in screen coordinates
    /// None -> inherit, Some(bounds) -> set bounds.
    pub bounds: Option<Bounds<DevicePixels>>,

    /// The display to create the window on, if this is None,
    /// the window will be created on the main display
    pub display_id: Option<DisplayId>,
}
```

This lets you specify a display id, which maps to the screen where the
window should be created and bounds relative to the upper left of the
screen.

Release Notes:

- Fixed positioning of popup windows (e.g. when sharing a project) when
using multiple external displays.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-26 13:07:38 -07:00
白山風露
35b39e02ce
Windows: Fullscreen (#9728)
~~This is still a work in progress, but to show the public where I am
working on it~~ Ready for review

TODO:
- [x] Justify fullscreen size to display
- [x] Record and apply restored size

Release Notes:

- N/A
2024-03-26 09:58:16 -07:00
张小白
f495ee0848
windows: implement mouse double click event (#9642)
Release Notes:

- N/A
2024-03-26 07:45:32 -07:00
Antonio Scandurra
fb6cff89d7
Introduce InlineCompletionProvider (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.

The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.

Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.

Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:

```rs
MyGlobal::update(cx, |global, cx| {
});
```

Release Notes:

- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 13:28:06 +01:00
Kirill Bulatov
b8663e56a9
Make UniformList non-occluding. (#9806)
Fixes https://github.com/zed-industries/zed/issues/9723

Move the `occlude` in the places where they are needed.

Release Notes:

- Fixed right click in the project panel's empty region
([9723](https://github.com/zed-industries/zed/issues/9723))

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-03-26 13:13:10 +02:00
Andrew Lygin
1b4c82dc2c
Fix next/prev shortcuts handling in the File Finder (#9785)
This PR fixes the unexpected File Finder behaviour described in
https://github.com/zed-industries/zed/pull/8782#issuecomment-2018551041

Any change of the modifier keys except for the release of the initial
modifier keys now prevents opening the selected file.

Release Notes:

- N/A
2024-03-25 14:06:37 -07:00
Paul
4789c02a19
X11: Double click (#9739)
This copies the logic from #9608 to the X11 client.

Fixes #9707.

Release Notes:
- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-25 11:44:31 -07:00
RoblKyogre
030e299b27
Fix key repeat after releasing a different key on Wayland (#9768)
Quick fix that fixes key repeat not working when releasing a different
key than the current one being held

Don't really know much rust yet, so unsure this is the best way to
handle this, but this does seem like a good starting point to get at
least a tad familiar with it

Release Notes:
- N/A
2024-03-25 11:44:24 -07:00
白山風露
6231df978b
Windows: fix initial active status (#9694)
Separate from #9451

On Windows, a new window may already active immediate after creation.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-25 11:44:18 -07:00
Ezekiel Warren
78dc458231
windows: Mouse wheel coordinates fix (#9749)
mouse scroll wasn't working unless the window was maximized or in the
top left corner because the Windows wheel events give screen coordinates

Release Notes:

- N/A
2024-03-25 11:14:51 -07:00
Raunak Raj
2646ed08e7
linux: Implement restart and app_path (#9681)
Added `restart` and `app_path` method for linux platform which was
marked as `//todo(linux)`


Release Notes:

- N/A
2024-03-25 11:14:29 -07:00
Daniel Zhu
569a7234fd
Handle first click on Zed window (#9553)
Fixes #4336
2024-03-25 10:52:18 -07:00
白山風露
5361a4d72d
Windows: Better cursor (#9451)
Moved `SetCursor` calls to `WM_SETCURSOR`, which occurs when OS is
requires set cursor.

Release Notes:

- N/A
2024-03-25 10:06:52 -07:00
Waffle Maybe
eec8660759
Use .is_some_and() instead of .is_some() && .unwrap() (#9704)
That's nicer & more readable.

(I just noticed that this looks weird while trying to understand why zed
changes my cursor, so decided to make a quick fix (btw the issue with
the cursor is that zed always loads cursor named "default" on wayland))

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-25 11:11:35 -04:00
Piotr Osiewicz
a7047f67fb
chore: Revert "gpui: update dependencies" (#9774)
Reverts zed-industries/zed#9741

/cc @niklaswimmer it looks like that PR change broke our rendering of
avatars (as @bennetbo found out) - they have a blue-ish tint now, which
I suppose might have to do with change between BGRA and RGBA. I'm gonna
revert it for now, let's reopen it though.


![image](https://github.com/zed-industries/zed/assets/24362066/3078d9c6-9638-441b-8b32-d969c46951e0)

Release Notes:

- N/A
2024-03-25 15:27:16 +01:00
Niklas Wimmer
7f9355e11f windows: update text system to new cosmic version
The same changes have been used on linux here 5003504031
and here 34832d49b09071846ff6f55f8ca1df019980a1df.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
6a22c8a298 gpui: Update image dependency
The latest update to resvg bumped some transitive dependencies
which lead to duplicates. The update to the image dependency
unifies most of their versions again.

Most notably, gif and kurbo are still duplicated, which is best fixed
downstream however.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
007acc4bc2 gpui: Update cosmic-text and resvg dependency
This unifies the rustybuzz dependency to the same version.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
97f1d61a4a gpui: make build dependencies mac only
This removes bindgen and cbindgen from the dependency graph on non-macos
systems, improving compile times on those systems.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
50ab60b9f0 gpui: update ashpd and open dependency
The ashpd update removes the dependency on an older zbus version which
decreases compile times.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Bennet Bo Fenner
ce57db497e
chat panel: Fix tooltips not working for links (#9691)
Closes #9418 

Noticed a difference in the `cx.set_tooltip(...)` calls between `div`
and `InteractiveText`. `div` calls `cx.set_tooltip(...)` inside
`after_layout`, but `InteractiveText` was calling this inside `paint`. I
believe as #9012 was merged, we need to call `cx.set_tooltip` inside
`after_layout`, as inserting inside `paint` does not seem to be
supported anymore.

I moved the code for setting the tooltip to `after_layout` and hovering
over links inside the chat seems to bring up the tooltips again.

Before:

See https://github.com/zed-industries/zed/issues/9418#issue-2189398784

After:


![image](https://github.com/zed-industries/zed/assets/53836821/a623164c-1ce0-40d7-bc53-020f176fba4a)


Release Notes:

- Fixed tooltip not showing up when hovering over links inside the chat
panel ([#9418](https://github.com/zed-industries/zed/issues/9418))
2024-03-22 14:47:57 +01:00
张小白
ae6f138b6c
Fix compute_width_for_char (#9643)
Release Notes:

- N/A
2024-03-22 09:10:42 +01:00
Daniel Zhu
441677c90a
Fix typo (mimized -> minimized) (#9674) 2024-03-21 16:14:31 -07:00
张小白
4183805a39
windows: fix window activate action (#9664)
Now, the window activation event can be triggered correctly. As shown in
the video, when the window is activated, the caret blinks; when the
window loses activation due to me clicking on the PowerShell window, the
caret stops blinking.



https://github.com/zed-industries/zed/assets/14981363/4c1b2bec-319d-4f21-879e-5a0af0a00d8e



Release Notes:

- N/A
2024-03-21 15:24:17 -07:00
张小白
1e543b9755
windows: implement IME caret movement and editing while composing (#9659)
https://github.com/zed-industries/zed/assets/14981363/598440f7-0364-4053-9f44-710291f8aa92



Release Notes:

- N/A
2024-03-21 12:10:22 -07:00
Mikayla Maki
e07192e4e3
Implement is_minimized for macOS (#9651)
Release Notes:

- N/A
2024-03-21 09:36:54 -07:00
张小白
d89905fc3d
Fix IME window position with scale factor greater than 1.0 (#9637)
In #9456 I forgot to handle this...

Release Notes:

- N/A
2024-03-21 09:31:43 -07:00
白山風露
e1d1d575c3
Windows: Fix XButton direction (#9629)
Release Notes:

- N/A
2024-03-21 09:31:19 -07:00
张小白
3fd62a2313
windows: display icon (#9571)
Now `Zed` can display icons. The image below shows the icon of the
`zed.exe` file and the icon in the right-click properties.

![Screenshot 2024-03-20
181054](https://github.com/zed-industries/zed/assets/14981363/8f1ccc7f-aab0-46cf-8c32-a3545ba710a3)

I used the `crates\zed\resources\app-icon@2x.png` file to generate the
`.ico` file. Due to some blank space around the logo in the original
file, the logo appears slightly smaller on Windows compared to other
software.

![Screenshot 2024-03-20
181155](https://github.com/zed-industries/zed/assets/14981363/874c5ed3-6796-428c-9a91-f91231bb6510)

The current `.ico` file contains logo files of multiple sizes: 16x16,
24x24, 32x32, 48x48, 64x64, 96x96, 128x128, 256x256, 512x512.

Release Notes:

- N/A
2024-03-21 09:30:01 -07:00
白山風露
f179158913
windows: Avoid recording minimized position to database (#9407)
Minimizing window records strange position to DB. When Zed is restarted,
the window goes far away.
<img width="975" alt="image"
src="https://github.com/zed-industries/zed/assets/6465609/98dbab71-fdbb-4911-b41a-9c3e498e5478">

So I fixed.

Release Notes:

- N/A
2024-03-21 09:15:16 -07:00
白山風露
f88f1bce20
Windows: Not logging frequent WM_PAINTs (#9566)
The logging of WM_PAINT for each frame was not very meaningful, so it
was eliminated.
Other logging levels were also reduced to trace.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-21 09:11:33 -07:00
Mikayla Maki
0b019282c3
Wayland: double click (#9608)
This PR builds off of an earlier version of
https://github.com/zed-industries/zed/pull/9595, rearranges some of the
logic, and removes an unused platform API.

Release Notes:

- N/A

---------

Co-authored-by: apricotbucket28 <agustin.nicolas.marcos@outlook.com>
2024-03-20 19:22:47 -07:00
Andrew Lygin
5602c48136
Action release handlers (#8782)
This PR adds support for handling action releases &mdash; events that
are fired when the user releases all the modifier keys that were part of
an action-triggering shortcut.

If the user holds modifiers and invokes several actions sequentially via
shortcuts (same or different), only the last action is "released" when
its modifier keys released.

~The following methods were added to `Div`:~
- ~`capture_action_release()`~
- ~`on_action_release()`~
- ~`on_boxed_action_release()`~

~They work similarly to `capture_action()`, `on_action()` and
`on_boxed_action()`.~

See the implementation details in [this
comment](https://github.com/zed-industries/zed/pull/8782#issuecomment-2009154646).

Release Notes:

- Added a fast-switch mode to the file finder: hit `p` or `shift-p`
while holding down `cmd` to select a file immediately. (#8258).

Related Issues:

- Implements #8757 
- Implements #8258
- Part of #7653 

Co-authored-by: @ConradIrwin
2024-03-20 18:43:31 -06:00
Mikayla Maki
91ab95ec82
Fix bugs in linux text system (#9604)
Supersedes https://github.com/zed-industries/zed/pull/9579 by manually
including it.

Release Notes:

- N/A
2024-03-20 15:27:56 -07:00
白山風露
b1feeb9f29
Windows: Refactoring (#9580)
Aggregate `DefWindowProc` calls with individual handler return value as
`Option<isize>`

Release Notes:

- N/A
2024-03-20 13:36:28 -07:00
Ezekiel Warren
d5e0817fbc
windows: Fix title bar height when maximized (#9449)
screenshots and description incoming

## title bar when window is maximized
| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/075a943d-54db-4b71-9fa0-15f823255182)
|
![image](https://github.com/zed-industries/zed/assets/1284289/39a1d381-fcfd-4651-aab4-231a8ec3bd99)
|

## ~~caption buttons at 200%~~
~~buttons are now properly responsive at different scales~~
~~closes #9438~~
~~proper scale factor handling in follow up PR (possibly #9440)~~

<details>
  <summary>out of date image</summary>


![scale-factor](https://github.com/zed-industries/zed/assets/1284289/299d37b8-0d2e-4f2e-81db-2fff6fc59a62)
</details>

should be fixed by https://github.com/zed-industries/zed/pull/9456


Release Notes:

- N/A
2024-03-19 20:54:00 -07:00
张小白
85c294da9a
windows: Implement app_version (#9410)
#### Call `app_version`:

![Screenshot 2024-03-16
011821](https://github.com/zed-industries/zed/assets/14981363/9e618e49-fee2-4e7a-b884-6b0be05a0c95)

#### `Zed.exe` info:

![Screenshot 2024-03-16
011856](https://github.com/zed-industries/zed/assets/14981363/2b17a5df-ad38-42d0-8396-53680d77101d)


Release Notes:

- N/A
2024-03-19 12:40:57 -07:00
Luke Jones
cfa0fc96f0
wayland: change some borrow_mut to borrow, reduce borrow scopes, fix two crashes (#9306)
Release Notes:

- N/A
2024-03-19 12:40:09 -07:00
张小白
086f4e63c5
windows: Properly handle DPI (#9456)
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.

This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.

`Zed` with a scale factor equals 1.5, and change between different scale
factors:



https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b



Release Notes:

- N/A
2024-03-19 12:39:36 -07:00
apricotbucket28
2c36652be2
wayland: fix handling of non-discrete scroll events (#9548)
https://github.com/zed-industries/zed/pull/9103 broke touchpad scrolling
on Wayland
This PR correctly filters the `Axis` to handle all non-discrete scroll
events (see
https://wayland.app/protocols/wayland#wl_pointer:enum:axis_source)

Should fix https://github.com/zed-industries/zed/issues/9525

Release Notes:

- N/A
2024-03-19 12:25:10 -07:00
Antonio Scandurra
2ea333fff6
Insert hitbox if div contains tooltip (#9545)
Release Notes:

- Fixed a bug that would cause certain tooltips to not show up
(preview-only).
2024-03-19 19:02:59 +01:00
Ezekiel Warren
ac6c4f3ca8
windows: fix 'space' keystroke keydown event (#9476)
the space key was being reported as key " " which didn't allow it to be
used in keybindings

Release Notes:

- N/A
2024-03-19 10:35:28 -07:00
Mikayla Maki
fd0071f2af
Add an animation to the LSP checking indicator (#9463)
Spinner go spinny.

Extra thanks to @kvark for helping me with the shaders.



https://github.com/zed-industries/zed/assets/2280405/9d5f4f4e-0d43-44d2-a089-5d69939938e9


Release Notes:

- Added a spinning animation to the LSP checking indicator

---------

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2024-03-19 10:16:18 -07:00
Kyle Kelley
56bd96bc64
Image viewer (#9425)
This builds on #9353 by adding an image viewer to Zed. Closes #5251.

Release Notes:

- Added support for rendering image files
([#5251](https://github.com/zed-industries/zed/issues/5251)).

<img width="1840" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/3bccfa8e-aa5c-421f-9dfa-671caa274c3c">

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 10:13:10 -07:00
Niklas Wimmer
7573f35e8e
Simplify and document parts of linux text system code (#9443)
I mainly focused on improving the `font_id` function, see the
description of e286483262 for more
details. The rest are some drive-by changes I could not resist to.

When I am right about af4d6c43ce, someone
with a Mac could change it there as well.

This PR is probably best reviewed commit by commit :)

cc @gabydd @h3mosphere

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-19 08:27:48 -07:00
白山風露
250528d28f
Windows: Auto close HANDLE (#9429)
`HANDLE` is wrapped in a RAII struct.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 08:21:01 -07:00
apricotbucket28
d8e32c3e3c
linux: scrolling improvements (#9103)
This PR adjusts scrolling to be a lot faster on Linux and also makes
terminal scrolling work.

For Wayland, it makes scrolling faster by handling the `AxisValue120`
event (which also allows high-resolution scrolling on supported mice)
On X11, changed the 1 line per scroll to 3.

### Different solutions

I tried replicating Chromium's scrolling behaviour, but it was
inconsistent in X11/Wayland and found it too fast on Wayland. Plus, it
also didn't match VSCode, since it seems that they do something
different.

Release Notes:

- Made scrolling faster on Linux
- Made terminal scroll on Linux
2024-03-18 14:50:29 -07:00
Mayfield
7c0a0e21ab
Add keyboard shortcut to suppress prompt while deleting files/dirs (#9452)
Completes #7228.
Adds back Backspace as the main delete key binding and makes Linux
bindings consistent with macOS

Release Notes:
- ⌘-Delete/⌘-Backspace will now suppress deletion confirmation prompts
in project panel
([#7228](https://github.com/zed-industries/zed/issues/7228)).
2024-03-18 11:43:43 -07:00
Ezekiel Warren
e22d31b52d
windows: Respect "appears transparent" for title bar (#9454)
now respecting the 'appears transparent' titlebar option which is used
in the storybook crate. created for #9453

# storybook

running

```
cargo run -p storybook components/text
```

| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/88cd93de-4ca9-40d6-aa53-aa7bc65e1f5c)
|
![image](https://github.com/zed-industries/zed/assets/1284289/b3528775-219b-46b7-9f99-da5b88330fbd)
|

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-18 11:39:46 -07:00
Ezekiel Warren
31aaee9130
windows: Don't propagate window char message (#9470)
we were accidentally calling the input handler even when the keydown
event asked it not to be propagated

Release Notes:

- N/A
2024-03-18 11:02:15 -07:00
Ezekiel Warren
0e83b22583
windows: Dispatch missing foreground tasks (#9469)
Some foreground tasks were being missed causing some unresponsiveness in
Zed. The foreground tasks used to happen but it was changed in #9351
(here:
https://github.com/zed-industries/zed/pull/9351/files#diff-5b5e706f04c15d77efd23989ec5b1b1cf73d36144e2d066a074de165533ecaeaL227)

Release Notes:

- N/A
2024-03-18 11:01:51 -07:00
Antonio Scandurra
3d08e20c72
Fix dispatching global actions from a window (#9502)
Fixes https://github.com/zed-industries/zed/issues/9313

Release Notes:

- Fixed a regression that caused global actions to stop working when
invoked from a window (preview-only)
([#9313](https://github.com/zed-industries/zed/issues/9313)).

Co-authored-by: Conrad <conrad@zed.dev>
2024-03-18 18:31:47 +01:00
Ezekiel Warren
4e17ce3b37
windows: credentials implementation (#9385)
Release Notes:

- N/A
2024-03-18 10:16:29 -07:00
张小白
64ebbb4afc
Update display info when window moved to another monitor (#9360)
Release Notes:

- N/A
2024-03-18 09:49:40 -07:00
Ezekiel Warren
9f96c43ff7
windows: Don't report 'shift' for certain keys (#9479)
allows keybindings for character such as `:`, `?`, etc. (important for
vim mode!)

alternative solution is here: #9478

Release Notes:

- N/A
2024-03-18 09:33:28 -06:00
白山風露
c2d5b33c20
windows: Fix Clippy warnings (#9426)
Just handling clippy warnings

Release Notes:

- N/A
2024-03-18 10:16:03 -04:00
Antonio Scandurra
52a9bc3e1b
Automatically create a hitbox for focusable elements (#9485)
Closes #9462

This fixes the focus story in the storybook.

Release Notes:

- N/A
2024-03-18 09:58:31 +01:00
Tobias Decking
80bc6c8cc8
Small cleanup of gpui manifest file (#9439)
Currently, gpui depends on env_logger as both a normal dependency and a
dev-dependency without
using the workspace defined version. This fixes it.
2024-03-16 12:59:18 +01:00
Conrad Irwin
f1d98dc748
Fix segfault in "install:cli" when app is not yet installed (#9427)
Release Notes:

- Fixed a panic running `cli: Install` or `cli: Register Zed Scheme`
before installing the app.
2024-03-15 21:16:09 -06:00
白山風露
c2b42e2bab
Windows: direct load DCompositionWaitForCompositorClock and fallback (#9351)
…timer

Fix: #9166

Release Notes:

- N/A
2024-03-15 17:17:26 -07:00
Marshall Bowers
0329b4a5cb
Allow loading "Segoe Fluent Icons" font on macOS (#9421)
This PR updates the `TextSystem` on macOS to allow loading the "Segoe
Fluent Icons" font.

We're using this font in the Storybook to render the `TitleBar` as it
would appear on Windows despite us running it on macOS. This is to make
things easier for iterating on UI design without needing to test on each
individual platform.

However, the "Segoe Fluent Icons" font does not have a glyph for the `m`
character, causing it to run afoul of a precautionary check added in
#4029, which ultimately results in the font not being loaded (and thus
rendering as a missing glyph).

We work around this by simply ignoring this check if the font we're
trying to load is specifically "Segoe Fluent Icons".

I think longer-term we'll need to revisit the behavior in the editor
that is causing the panics when the `m` glyph is missing from the font,
but that's a problem for a different day.

#### Before

<img width="1283" alt="Screenshot 2024-03-15 at 3 34 38 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c0ddd46d-8599-4729-ac98-75522b33e25b">

#### After

<img width="1113" alt="Screenshot 2024-03-15 at 5 12 36 PM"
src="https://github.com/zed-industries/zed/assets/1486634/183c2b43-5e4f-4516-8856-7a2d45ed8b2e">

Note that you currently need to install the "Segoe Fluent Icons" font
yourself—either installing it globally or placing the `.ttf` file in the
`assets/fonts` directory—in order to see the icons rendered. I'd like to
look into getting this, but there are restrictions on the distribution
of the font on non-Windows platforms that will need to be followed.

Release Notes:

- N/A
2024-03-15 17:35:10 -04:00
Ezekiel Warren
db43479be8
windows: active window implementation (#9314)
active window implementation - bonus vim mode works on windows now

Release Notes:

- N/A
2024-03-15 10:54:45 -07:00
Mikayla Maki
328aa2cc95
Cross-platform titlebar (#9405)
This PR reverts https://github.com/zed-industries/zed/pull/9392 and
fixes the regressions that led to the reversion.

Release Notes:

- N/A

---------

Co-authored-by: Ezekiel Warren <ezekiel@seaube.com>
2024-03-15 10:40:58 -07:00
Mikayla Maki
487ae73bcc
Fix sharp corners on images (#9408)
Release Notes:

- N/A
2024-03-15 10:22:32 -07:00
Matthias Grandl
b38e3f16ad
gpui: img element object-fit (#9393)
Release Notes:

- Added [object-fit
API](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) to the
`img` element. This allows the user to decide how the image is scaled
within the element bounds.
- Fixes corner radius not working as expected on overflowing elements.
2024-03-15 10:06:07 -07:00
Daniel Zhu
cb16003133
Fill context menu of Zed macOS dock icon with recent projects (#8952)
Fixes https://github.com/zed-industries/zed/issues/8416

Release Notes:

- Added recent projects into Zed's macOS dock icon context menu ([8416](https://github.com/zed-industries/zed/issues/8416))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-03-15 16:22:43 +02:00
Thorsten Ball
5bf0c8ed2d
Revert "windows: better looking titlebar" and follow-up (#9392)
This reverts #9053 and #9375 because they introduced a regression on
`main` that broke the titlebars on macOS:


![image](https://github.com/zed-industries/zed/assets/1185253/d046003b-5c66-4a42-9385-623f5d58c9a4)

Two things are off:

- Left padding is missing
- Titlebar height is less than it was before, which means the
traffic-light buttons are not centered vertically

What @as-cii and I noticed while looking into this: the `cfg!(macos)`
macros that were used don't work like that. You need to check for
`cfg!(target = "macos")` etc. Means that on macOS we never used the
macOS-specific code because the condition was always false.

Overall height, we're not sure about.

Release Notes:

- N/A
2024-03-15 12:25:51 +01:00
Antonio Scandurra
5ae145145e
Fix flickering when interacting with the language server logs (#9390)
Fixes https://github.com/zed-industries/zed/issues/9340

The flickering was caused by the pane trying to restore focus on a
`FocusHandle` that wasn't being rendered anymore. This commit uses the
new `WeakFocusHandle` to avoid retaining a reference to focus handles
that don't exist anymore.

Release Notes:

- Fixed a bug that caused flickering when interacting with the language
server logs
([#9340](https://github.com/zed-industries/zed/issues/9340)).
2024-03-15 11:15:07 +01:00
Ezekiel Warren
f9b9123606
chore: cleanup more windows use (#9376) 2024-03-14 18:00:03 -07:00
Mikayla Maki
8c43e10de7
whoops (#9375)
Release Notes:

- N/A
2024-03-14 17:22:00 -07:00
Ezekiel Warren
948b3827c8
windows: better looking titlebar (#9053)
~~work in progress. not ready for review. made for visibility only, but
feel free to comment :)~~

TODO:
- [x] add close/min/max buttons (to be rendered with gpui)
- [x] snap layout support
- [x] fix issues with clicking items in titlebar
- [x] cleanup/document

Release Notes:

- Added custom windows titlebar

![](https://media.discordapp.net/attachments/1208481909676576818/1216985375969378324/caption-buttons-working.gif?ex=660260f4&is=65efebf4&hm=53a17af6e2f233eba54302a5adb9efe23900f4d6f6d1d854bec887120789130c&=)

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-14 17:20:30 -07:00
Ezekiel Warren
6bbc5e2efa
windows: cleanup window crate uses (#9374) 2024-03-14 16:42:53 -07:00
张小白
845eb64615
Windows: IME support (#9188)
Waiting for #9180 to be merged.

The behavior of IME windows is consistent with VS Code.



https://github.com/zed-industries/zed/assets/14981363/14913219-7345-4fec-9cc5-623d0c60acc9




Release Notes:
- N/A
2024-03-14 15:29:25 -07:00
张小白
c2d27c44f9
Use Windows native API to impl dispatcher (#9280)
Using `Threadpool` and `TimerQueue` which are provided by the native
Windows APIs, to implement the corresponding interfaces, we do not need
to sort tasks ourselves as Windows will handle it in a relatively more
efficient manner, I guess. I am unsure if Zed would welcome this PR, and
suggestions are welcome.

Release Notes:

- N/A
2024-03-14 15:13:26 -07:00
Mikayla Maki
35c9216ed7
Fix window restoration bugs (#9358)
- [x] fixes https://github.com/zed-industries/zed/issues/9349
- [x] fixes https://github.com/zed-industries/zed/issues/4656
- [x] fixes https://github.com/zed-industries/zed/issues/8345

Release Notes:

- TODO
2024-03-14 14:25:12 -07:00
Antonio Scandurra
51261c553f
Fix double-clicking titlebar to zoom (#9323)
Fixes https://github.com/zed-industries/zed/issues/9300

This was a regression caused by not inserting a hitbox when a div only
had click listeners on it.

Release Notes:

- Fixed a regression that disabled double-clicking on the titlebar to
zoom the window.
([#9300](https://github.com/zed-industries/zed/issues/9300))
(preview-only)
2024-03-14 09:37:31 +01:00
Conrad Irwin
b65aa7e2a7
Fix accidental leak of text stack between frames (#9297)
Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Marshall <marshall@zed.dev>

Release Notes:

- Fixed a bug where text styles could leak between frames (preview only)

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2024-03-13 15:03:45 -06:00
张小白
3274cc93df
Windows: impl WindowsDisplay (#9287)
Tested on my laptop, and I've noticed that when I move the window,
`WindowsPlatform::displays()` is being continuously called. Is this
intended?

Release Notes:

- N/A
2024-03-13 13:08:11 -07:00
张小白
36cbfbfb94
windows: Better keyboard input support (#9180)
### Description

Currently, there are some issues with input handling on Windows:

#### 1. Direct crash when encountering IME input.



https://github.com/zed-industries/zed/assets/14981363/598f7272-1948-4a42-99c5-2ef7b9162a1e


#### 2. Handling messages every 1/60 seconds in the main thread. Despite
being named "immediate_handle," it's not exactly immediate.

```rust
// actually halt here
let wait_result =
    unsafe { DCompositionWaitForCompositorClock(Some(&[self.inner.event]), INFINITE) };

// compositor clock ticked so we should draw a frame
if wait_result == 1 {
    unsafe { invalidate_thread_windows(GetCurrentThreadId()) };

    while unsafe { PeekMessageW(&mut msg, HWND::default(), 0, 0, PM_REMOVE) }.as_bool()
```

#### 3. According to Windows recommendations, character input should be
obtained using `WM_CHAR` instead of `WM_KEYDOWN`. Additionally, there
are problems with the handling within `WM_CHAR`.

```rust
fn handle_char_msg(&self, wparam: WPARAM) -> LRESULT {
        let mut callbacks = self.callbacks.borrow_mut();
        if let Some(callback) = callbacks.input.as_mut() {
            let modifiers = self.current_modifiers();
            let msg_char = wparam.0 as u8 as char; // these are u16 chars, cant treat them as u8
```

And, we don't handle `WM_SYSKEYDOWN` properly, which leads to `Alt + F4`
not working.

Release Notes:

- N/A
2024-03-13 12:10:22 -07:00
Antonio Scandurra
139bb3275a
Automatically reset cursor style when hit test changes (#9289)
Release Notes:

- N/A

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-03-13 17:21:25 +01:00
Antonio Scandurra
fc9f84446a
Always stop propagation in div's scroll wheel listener (#9282)
Fixes #9274

This fixes a bug that was preventing the editor hover popovers from
being scrolled with the trackpad.

Release Notes:

- N/A
2024-03-13 15:48:22 +01:00
Piotr Osiewicz
427d66990c
gpui: Do not emit MouseUpEvent when exiting drag & drop (#9273)
Fixes #9198

Release Notes:

- Fixed a bug where empty panes could be created during drag & drop.
2024-03-13 11:37:34 +01:00
Thorsten Ball
754df9356d
Fix segfault when dropping MacWindow (#9267)
This avoids calling `window.setDelegate(nil)` when the window was
already closed.

Release Notes:

- Fixed a segfault that could show up when closing windows.

Co-authored-by: Antonio <antonio@zed.dev>
2024-03-13 10:41:25 +01:00
Thorsten Ball
3c28282108
Redraw when toggling between windows (#9236)
Before this change we didn't consistently trigger focus events when
toggling between with windows `Cmd-backtick`. We only triggered them
when the OS decided to trigger a redraw.

That lead to a nasty bug that showed up in Vim mode where a cursor would
still be active in the hidden window, even though it was deactivated.

One then had to manually try to trigger a focus event in the new window
to activate the cursor.

With this change, we call `cx.refresh` when the window activation status
changed which triggers focus events consistently and fixes this bug.

With logging we can observe this:

**BEFORE**:


https://github.com/zed-industries/zed/assets/1185253/e1ad8878-129c-44ba-9d8b-c720f9dca5b6


**AFTER**:


https://github.com/zed-industries/zed/assets/1185253/733fdadb-d1ea-47fe-a2c1-7b50af299cc0


Release Notes:

- Fixed focus not being consistently changed when switching between
multiple Zed windows via `Cmd-backtick`.

---------

Co-authored-by: Manu Raj <git@manuraj.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2024-03-13 10:15:22 +01:00
Rajesh Malviya
80b80dfa78
gpui: Switch to x11rb (#9113)
Switch to using `x11rb` crate instead of current `xcb` crate for gpui's
x11 platform.

Also fixes the crash on resize, and white flashing on resize.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-12 21:47:08 -07:00
Mikayla Maki
e792c1a5c5
Open new windows with a default size and position (#9204)
This PR changes GPUI to open windows with a default size and location,
and to otherwise inherit from their spawning window.

Note: The linux build now crashes on startup.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Ezekiel Warren <zaucy@users.noreply.github.com>
2024-03-12 21:19:51 -07:00
张小白
9a2dceeea1
windows: Support dropping targets with filenames longer than 260 characters (#9115)
use `Vec` instead of slice to support dynamic filename length.

Release Notes:
- N/A
2024-03-12 21:19:31 -07:00
bbb651
a105b5f215
Wayland: Remove bogus wl_surface::commits on resize (with integer scaling) (#9245)
Release Notes:
- N/A

This prevents a crash on sway (on older versions without fractional
scaling). This means the resize is delayed until the next this we
present a frame, we need to investigate if this is the correct this to
do.
2024-03-12 19:46:18 -07:00
Antonio Scandurra
39a0841ea8
Center dock resize handle hitboxes (#9225)
Also, add a `deferred` function which takes an element to paint after
the current element tree.

Release Notes:

- Improved the size and position of the hitbox for resizing left, right,
and bottom panels.
([#8855](https://github.com/zed-industries/zed/issues/8855))

Co-authored-by: Julia <julia@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2024-03-12 15:42:18 +01:00
Antonio Scandurra
409aa513d4
Fix mouse interactions with the project and branch switchers (#9222)
Previously, we were considering the mouse to be "out" of a div when its
hitbox wasn't hovered. However, if a parent listened for
"mouse_down_out" and a child occluded the parent, the parent would
always think the mouse was out even when the user clicked the child.

This commit changes the definition of "mouse out" to simply mean "does
not contain the point", without accounting for occlusion.

Release Notes:

- N/A

Co-authored-by: Julia <julia@zed.dev>
2024-03-12 15:30:27 +01:00
Antonio Scandurra
0a341261d0
Insert hitbox when an interactive element can be scrolled (#9216)
Fixes https://github.com/zed-industries/zed/issues/9199


Release Notes:

- N/A
2024-03-12 12:24:15 +01:00
Vitor Ramos
3bd9d14420
linux: Fix panic missing screen mode for crtc specified mode ID (#9106)
Fix panic caused by missing screen mode for specified crtc mode id #9105
by searching over all crtcs instead of using the first one which may be
invalid.
2024-03-11 09:04:05 -07:00
charles-r-earp
95b311cb90
linux: gpui add Keysym::ISO_Left_Tab (#9126)
Fixes #9089.

On linux, pressing shift and tab together can potentially produce
`ISO_Left_Tab`. This PR maps this key to "tab" with the shift modifier,
similar to `SHIFT_TAB_KEY` in gpui::platform::mac::events.

Note: The [default linux
keymaps](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-linux.json)
have shift-tab mapped to editor::TabPrev and ctrl-[ mapped to
editor::Outdent. Both actions appear to have the same effect.

Release Notes:

- Support shift-tab on linux (#9089).
2024-03-11 09:03:15 -07:00
Joel Selvaraj
20d5f5e8da
linux: wayland cursor fixes (#9047)
Release Notes:

- Fixed wayland cursor style handling


In upcoming Gnome 46, cursor icon names are considerably changing. For
example: this commit
74e9b79471
removed/modified a lot of cursor names. Then some of the names were
reintroduced in this commit
6f64dc55dc.
I also tried upcoming KDE Plasma 6. Some of the cursor names are not
used commonly between Gnome and KDE. From my analysis, these set of
cursor names should be more widely available in both previous and
upcoming release of Gnome and KDE.

Also, If a cursor style is not available, let's fallback to default
cursor style. This avoids scenarios where we get stuck with special
cursor styles like IBeam/Resize* because the current cursor style is not
available. This will lead to an unpleasant/broken experience. Falling
back to default cursor seems to be more acceptable.
2024-03-11 08:38:52 -07:00
白山風露
a04932c4eb
Windows: fix crash with unhandled window (#9164)
On Windows, some windows may be created that are not managed by the
application.
For example, the Japanese IME creates pop-ups like this one.

<img width="325" alt="image"
src="https://github.com/zed-industries/zed/assets/6465609/503aaa0a-7568-485a-a138-e689ae67001c">

The internal data associated with such a window is different from
`WindowsWindowInner` and will crash if referenced.
Therefore, before calling `try_get_window_inner`, it checks if it is an
owned window.


Release Notes:

- N/A
2024-03-11 08:28:18 -07:00
白山風露
2244419dfd
Add missed pad (#9175)
Sorry I missed explicitly `Quad::pad` insertion at #9172.

The struct layout is unchanged and does not affect the behavior.

Release Notes:

- N/A
2024-03-11 08:21:52 -07:00
白山風露
eb5e18c66d
Fix blade validation failure (#9172)
Fix: #9167

Release Notes:

- N/A
2024-03-11 08:06:20 -07:00
Antonio Scandurra
298314d526
Fix regressions introduced by flicker fix (#9162)
This pull request fixes a couple of easy regressions we discovered right
after using #9012 on nightly:

- Popover buttons for a chat message were being occluded by the message
itself.
- Scrolling was not working on the `List` element.

Release Notes:

- N/A
2024-03-11 12:11:51 +01:00
Antonio Scandurra
4700d33728
Fix flickering (#9012)
See https://zed.dev/channel/gpui-536

Fixes https://github.com/zed-industries/zed/issues/9010
Fixes https://github.com/zed-industries/zed/issues/8883
Fixes https://github.com/zed-industries/zed/issues/8640
Fixes https://github.com/zed-industries/zed/issues/8598
Fixes https://github.com/zed-industries/zed/issues/8579
Fixes https://github.com/zed-industries/zed/issues/8363
Fixes https://github.com/zed-industries/zed/issues/8207


### Problem

After transitioning Zed to GPUI 2, we started noticing that interacting
with the mouse on many UI elements would lead to a pretty annoying
flicker. The main issue with the old approach was that hover state was
calculated based on the previous frame. That is, when computing whether
a given element was hovered in the current frame, we would use
information about the same element in the previous frame.

However, inspecting the previous frame tells us very little about what
should be hovered in the current frame, as elements in the current frame
may have changed significantly.

### Solution

This pull request's main contribution is the introduction of a new
`after_layout` phase when redrawing the window. The key idea is that
we'll give every element a chance to register a hitbox (see
`ElementContext::insert_hitbox`) before painting anything. Then, during
the `paint` phase, elements can determine whether they're the topmost
and draw their hover state accordingly.

We are also removing the ability to give an arbitrary z-index to
elements. Instead, we will follow the much simpler painter's algorithm.
That is, an element that gets painted after will be drawn on top of an
element that got painted earlier. Elements can still escape their
current "stacking context" by using the new `ElementContext::defer_draw`
method (see `Overlay` for an example). Elements drawn using this method
will still be logically considered as being children of their original
parent (for keybinding, focus and cache invalidation purposes) but their
layout and paint passes will be deferred until the currently-drawn
element is done.

With these changes we also reworked geometry batching within the
`Scene`. The new approach uses an AABB tree to determine geometry
occlusion, which allows the GPU to render non-overlapping geometry in
parallel.

### Performance

Performance is slightly better than on `main` even though this new
approach is more correct and we're maintaining an extra data structure
(the AABB tree).


![before_after](https://github.com/zed-industries/zed/assets/482957/c8120b07-1dbd-4776-834a-d040e569a71e)

Release Notes:

- Fixed a bug that was causing popovers to flicker.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
2024-03-11 10:45:57 +01:00
Andrew
39bd12a557
gpui: add set menus example (#9131)
Add an example showing how to add a menu item, register an action with
the `AppContext`, and successfully call the action.

Release Notes:

- N/A
2024-03-11 09:56:45 +02:00
Mikayla Maki
ca696fd5f6
Add rs-notify implementation of fs::watch (#9040)
This PR simplifies the Zed file system abstraction and implements
`Fs::watch` for linux and windows.

TODO:
- [x] Figure out why this fails to initialize the file watchers when we
have to initialize the config directory paths, but succeeds on
subsequent runs.
- [x] Fix macOS dependencies on old fsevents::Event crate

Release Notes:

- N/A
2024-03-08 22:18:44 -08:00
Jason Wen
456efb53ad
windows: Add file dialog using IFileOpenDialog (#8919)
Release Notes:

- Added a file dialog for Windows
2024-03-08 20:07:48 -08:00
bbb651
efe5203a09
GPUI: Wayland: Add fullscreen, minimize and avoid unnecessary resizes (#9060)
Release Notes:
- N/A
2024-03-08 19:52:36 -08:00
张小白
a550b9cecf
Impl prompts and savefile dialog on Windows (#9009)
### Description
This is a part of #8809 , and this PR dose not include `open file
dialog`, as I already saw two PRs impl this.



https://github.com/zed-industries/zed/assets/14981363/3223490a-de77-4892-986f-97cf85aec3ae




Release Notes:

- N/A
2024-03-08 08:14:47 -08:00
Conrad Irwin
ed8aa6d200
Fix panic in layout_line when Y coordinate is too high (#9052)
Release Notes:

- N/A
2024-03-07 22:33:44 -07:00
EricApostal
aa7be4b5d8
Add clipboard support for Windows (#8978)
Release Notes:

- Added Read / Write clipboard support to Windows via copypasta

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-07 20:16:38 -08:00
Small White
b50f86735f
Impl drag-drop action for Windows (#8959)
### Description

This is a part of #8809 



https://github.com/zed-industries/zed/assets/14981363/2b085b9d-8b83-4ac7-8b84-07c679760eba




Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-07 15:59:48 -08:00
Rom Grk
2d83580df4
linux: enable test TextSystem (#9037)
Make text tests work on linux.
2024-03-07 15:51:52 -08:00
Kirill Bulatov
ffebe2e4a6
Initial Linux nightly bundles upload (#8913)
Changes Zed CI to build and upload Linux nightly bundles.

* `todo!(linux)` are replaced with `TODO linux` to make `todo!`-based
workflows more convenient
* renames `run-build-dmg` label into `run-bundling`, also renames a few
GH Actions entries to be more generic
* make another upload path for Linux, which keeps a separate file with SHA to version the nightly artifact.
* adds a `*.deb` package building with a couple of caveats, marked with
new `TODO linux` entries:

1. `cargo-bundle` is not very flexible, so it generates artifacts with
the structure and names that we're unable to alter before/during the
generation.
For that, a set of extra steps is made by repacking the *.deb package —
this is not very portable between different Linux distros, so later one
needs to find a way to combine multiple package types in this script.

2. `cargo-bundle` is not able to properly generate the *.msi bundle
despite declaring it in the features:
https://github.com/burtonageo/cargo-bundle/issues/116
Windows needs to invent its own way of bundling or fix the tool.

3. Both `cli` and `zed` binaries are added into the archive under
`/usr/local/bin/` path with their `-$channel` suffix
(-nightly/-preview/-dev/-stable) and a `/usr/local/bin/zed ->
/usr/local/bin/cli-nightly` symlink is made to make CLI work as Zed
launcher:
```
~/work/zed kb/linux-nightly:origin/kb/linux-nightly*​ ❯ dpkg -c target/zed_amd64.deb 
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/local/
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/local/bin/
-rwxr-xr-x allaptop/allaptop 8746832 2024-03-06 00:53 ./usr/local/bin/cli-nightly
-rwxr-xr-x allaptop/allaptop 689078560 2024-03-06 00:53 ./usr/local/bin/zed-nightly
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/applications/
-rw-r--r-- allaptop/allaptop       153 2024-03-06 00:53 ./usr/share/applications/zed.desktop
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/apps/
-rw-r--r-- allaptop/allaptop    716288 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/apps/zed.png
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/apps/
-rw-r--r-- allaptop/allaptop    239870 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/apps/zed.png
lrwxrwxrwx allaptop/allaptop         0 2024-03-06 00:53 ./usr/local/bin/zed -> /usr/local/bin/cli-nightly
```

But the CLI does not work under Linux yet and there's no way to install
that CLI from Zed now; Zed binary itself is not able to open
`file/location:12:34`-like things and set up the env properly, but is
able to start or open a directory.

So, this structure can be considered temporary and changed, if needed.

4. Zed Nightly on Linux does not know how to update itself, so all
nightly publishing is not picked up automatically.

5. Rust cache from `main` builds does not get shared between CI jobs,
due to being run in a different CI job that forms a different CI key, so
```
      - name: Cache dependencies
        uses: swatinem/rust-cache@v2
        with:
          save-if: ${{ false }}
```
would not work.
This makes Linux bundling jobs long.

Release Notes:

- N/A
2024-03-07 23:22:53 +02:00
Conrad Irwin
284a57d4d1
Fix panic in open urls (#9032)
Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-03-07 13:52:50 -07:00
Rom Grk
9068911eb4
wayland: don't dispatch modifier key events (#9027)
Modifier keys are dispatched as events on wayland, unlike macos. This
prevents pending bindings from matching, because something like e.g. `g
shift-e` is received by the key matcher as `g shift shift-e`.
2024-03-07 12:42:48 -08:00
Yesterday17
105e654dce
Include font_features in cache key for fonts (#8928)
## Release Notes

- Fixed font ligatures not always respecting the setting
([#4313](https://github.com/zed-industries/zed/issues/4313)).

## Preview


![20240306133121_rec_-convert](https://github.com/zed-industries/zed/assets/8667822/dc2aaa00-41d0-4fe9-8d9c-80e1f047894d)
2024-03-07 11:06:19 -05:00
Mikayla Maki
8a92d28663
Remove todo! comments (#8981)
Switching fully to normal `todo` style

Release Notes:

- N/A
2024-03-06 18:25:20 -08:00
Mikayla Maki
c0edb5bd6c
GPUI custom window prompts (#8980)
This adds a GPUI fallback for window prompts. Linux does not support
this feature by default, so we have to implement it ourselves.

This implementation also makes it possible for GPUI clients to override
the platform prompts with their own implementations.

This is just a first pass. These alerts are not keyboard accessible yet,
does not reflect the prompt level, they're implemented in-window, rather
than as popups, and the whole feature need a pass from a designer.
Regardless, this gets us one step closer to Linux support :)

<img width="650" alt="Screenshot 2024-03-06 at 5 58 08 PM"
src="https://github.com/zed-industries/zed/assets/2280405/972ebb55-fd1f-4066-969c-a87f63b22a6f">

Release Notes:

- N/A
2024-03-06 18:15:06 -08:00
bbb651
c8e03ce42a
Wayland: Support integer scaling without wp_fractional_scale (#8886)
Release Notes:
- N/A

`DoubleBuffered` is not currently very necessary because we only care
about a single field `OutputState::scale` but I think it can be useful
for other objects as it's a fairly common pattern in wayland.
2024-03-06 18:13:23 -08:00
intigonzalez
74e7611ceb
windows: get current display size (#8916)
For the moment the windows port has a single display with hard-coded
values.

This first PR is just to at least fetch the **actual size of the current
display**. The idea
is using this code as a first template to start getting familar with the
code base
and prepare the work for enumerating all displays.
2024-03-06 18:12:44 -08:00
Max Brunsfeld
675ae24964
Add a command for building and installing a locally-developed Zed extension (#8781)
This PR adds an `zed: Install Local Extension` action, which lets you
select a path to a folder containing a Zed extension, and install that .
When you select a directory, the extension will be compiled (both the
Tree-sitter grammars and the Rust code for the extension itself) and
installed as a Zed extension, using a symlink.

### Details

A few dependencies are needed to build an extension:
* The Rust `wasm32-wasi` target. This is automatically installed if
needed via `rustup`.
* A wasi-preview1 adapter WASM module, for building WASM components with
Rust. This is automatically downloaded if needed from a `wasmtime`
GitHub release
* For building Tree-sitter parsers, a distribution of `wasi-sdk`. This
is automatically downloaded if needed from a `wasi-sdk` GitHub release.

The downloaded artifacts are cached in a support directory called
`Zed/extensions/build`.

### Tasks

UX

* [x] Show local extensions in the Extensions view
* [x] Provide a button for recompiling a linked extension
* [x] Make this action discoverable by adding a button for it on the
Extensions view
* [ ] Surface errors (don't just write them to the Zed log)

Packaging

* [ ] Create a separate executable that performs the extension
compilation. We'll switch the packaging system in our
[extensions](https://github.com/zed-industries/extensions) repo to use
this binary, so that there is one canonical definition of how to
build/package an extensions.

### Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-06 15:35:22 -08:00
Small White
af87fb98d0
Implement more GPUI services on windows. (#8940)
### Description

This is a part of #8809 , impl the following functions:

- `os_version`
- `local_timezone`
- `double_click_interval`
- `set_cursor_style`
- `open_url`
- `reveal_path`

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-06 12:48:43 -08:00
Andrew Lygin
effc317a06
Fix project panel scrolling position restoration (#8961)
Project panel loses the last scrolling position every time the user
hides/shows it. This PR fixes the problem.

The reason of the problem is that `UniformListScrollHandle`, which is
intended to store the scrolling position between redrawings, is only
used for ad-hoc autoscrollings to the list items, while the
`interactivity.scroll_handle` that is responsible for the scrolling
position, doesn't survive the project panel hiding.

How the problem looks:


https://github.com/zed-industries/zed/assets/2101250/7c7e3da6-9a9d-4f28-a181-ee9547349d4c

Release Notes:

- Fixed scrolling position restoration in the Project Panel.
2024-03-06 12:00:51 -08:00
Ezekiel Warren
06035dadea
windows: more frequent frame requests (#8921)
Note rust analyzer running in background now without keyboard/mouse
movement.

![](https://media.discordapp.net/attachments/1208481909676576818/1214769879098597416/high-framerate-windows.gif?ex=65fa519c&is=65e7dc9c&hm=4c9ba72fa3c3c548964e46d9c07f0c0bf9545ed9a9ae11495101dcae5db06d59&=)

Release Notes:

- Improved frame rate on Windows
2024-03-06 11:54:33 -08:00
Max Brunsfeld
6036830049
Throttle the sending of UpdateFollowers messages (#8918)
## Problem

We're trying to figure out why we sometimes see high latency when
collaborating, even though the collab server logs indicate that messages
are not taking long to process.

We think that high volumes of certain types of messages, including
`UpdateFollowers` may cause a lot of messages to queue up, causing
delays before collab sees certain messages.

## Fix

This PR reduces the number of `UpdateFollowers` messages that clients
send to collab when scrolling around or moving the cursor, using a
time-based throttle.

The downside of this change is that scrolling will not be as smooth when
following someone. The advantage is that it will be much easier to keep
up with the stream of updates, since they will be sent much less
frequently.

## Release Notes:

- Fixed slowness that could occur when collaborating due to excessive
messages being sent to support following.

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-06 14:58:41 +01:00
Marshall Bowers
22fe03913c
Move Clippy configuration to the workspace level (#8891)
This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A
2024-03-05 12:01:17 -05:00
Dzmitry Malyshau
52f750b216
Update blade to latest: work around Intel+NVidia driver bug (#8811)
Picks up https://github.com/kvark/blade/pull/92
Should unblock some of the unhappy users.
Upstream bug - https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688

Release Notes:
- N/A
2024-03-05 08:48:34 -08:00
Ezekiel Warren
36c4831806
windows: mouse and keyboard (#8791)
Windows mouse and keyboard working! I also tweaked the message loop so
that it didn't get stuck. The peek message loop was almost never
returning for me during testing.

Release Notes:

- Added windows mouse and keyboard support

![windows-mouse-and-keyboard](https://github.com/zed-industries/zed/assets/1284289/08578fbf-0cb2-4e44-bab1-3c4f0291ea4b)
2024-03-05 08:35:07 -08:00
Jason Lee
0b34b1de7b
Fix first/last item margin on scroll (#8880)
![output](https://github.com/zed-industries/zed/assets/5518/e39a3600-99c4-4d3c-baee-efd53a474f38)

Before:

https://github.com/zed-industries/zed/assets/5518/f7a4563a-504a-4a41-bfd4-21e9439cd02b

After:

https://github.com/zed-industries/zed/assets/5518/0ba41527-46fd-404f-8207-1b8c5cf37434


Release Notes:

- Fixed first and last item margin when scroll view has padding
2024-03-05 15:54:48 +02:00
Quadri A. Adekunle
4167c66b86
macOS: Fix center window with fixed bounds size (#8475)
This PR fixes window showing up in the center of the monitor when
`center: true` option is provided.

The idea is to set the `window_wize` when creating the `window` using
`native_window.initWithContentRect_styleMask_backing_defer_screen_()`

Before: 

<img width="851" alt="SCR-20240227-qokf"
src="https://github.com/zed-industries/zed/assets/20229808/27494966-2e97-4771-8837-ccb6658ced78">

After:

<img width="1132" alt="SCR-20240227-qlmg"
src="https://github.com/zed-industries/zed/assets/20229808/439568da-d380-4331-8d19-cd501f211c4c">


Release Notes:

- N/A
2024-03-04 17:08:29 -07:00
Conrad Irwin
f53823c840
Remove release channel from Zed URLs (#8863)
Also adds a new command `cli: Register Zed Scheme` that will cause URLs
to be opened in the current zed version, and we call this implicitly if
you install the CLI

Also add some status reporting to install cli

Fixes: #8857



Release Notes:

- Added success/error reporting to `cli: Install Cli`
([#8857](https://github.com/zed-industries/zed/issues/8857)).
- Removed `zed-{preview,nightly,dev}:` url schemes (used by channel
links)
- Added `cli: Register Zed Scheme` to control which zed handles the
`zed://` scheme (defaults to the most recently installed, or
the version that you last used `cli: Install Cli` with)
2024-03-04 16:08:47 -07:00
Christian Bergschneider
09760340ca
linux: remove todo for credential implementation (#8834)
As commented
[here](https://github.com/zed-industries/zed/pull/8035#issuecomment-1976894590),
this is already done.



Release Notes:
- N/A
2024-03-04 08:57:56 -08:00
Rom Grk
996f1036fc
linux: clipboard (#8822)
Linux clipboard implementation with `copypasta`.


Release Notes:

- Added linux clipboard support
2024-03-04 08:00:24 -08:00
Rom Grk
c91969d828
linux/wayland: prevent possible panic (#8824)
Prevent a panic from arising from this case:
https://github.com/zed-industries/zed/pull/8632#discussion_r1510015928

It's not really safe to dispatch any action before dropping the state
borrow, because it may need to be modified.
2024-03-04 05:57:47 -08:00
Niklas Wimmer
ff65008316
linux: add credentials impl via oo7 (#8035)
This change implements gpui's credentials API for the linux platform,
using the [`oo7`](https://lib.rs/crates/oo7) library.

We had a short discussion on Discord about where to store credentials
and landed on the two dbus APIs
[`org.freedesktop.Secrets`](https://specifications.freedesktop.org/secret-service/latest/index.html)
and
[`org.freedesktop.portal.Secrets`](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Secret.html).
The first one provides access to a more or less general purpose
keystore, the second provides a way of obtaining a unique masterkey
which in turn can be used for encrypting stuff and storing it to disk
(especially interesting for sandboxed apps, think flatpak/snap).

I decided to give the implementation a try with `oo7`, which uses the
portal if the app is sandboxed and the secret service otherwise. If we
do not want to use that library, we would probably have to more or less
copy its functionality anyways. I also heard rumors of eventually
changing the credentials API and I think this implementation serves as a
starting point to discuss the need for this?

With a working credentials implementation the sign in button now works
(it panicked before).

Todos:
- [x] implement keystore unlocking
- [x] try the change with oo7's tracing enabled?
- [x] test the password deletion

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-03 13:54:06 -08:00
Mikayla Maki
0717d30389
Move windows up to workspace dependency (#8786)
This way we can keep track of what we're using.

Release Notes:

- N/A
2024-03-03 11:58:31 -08:00
Maharshi Basu
a5eab29662
Implement all_font_families for the LinuxTextSystem (#8331)
Implemented the function to get all font family names for
`LinuxTextSystem` which was previously kept as `unimplemented`.

Release Notes:

- N/A

Change Explanation:

- We get the
[`&Database`](https://docs.rs/fontdb/0.16.1/fontdb/struct.Database.html)
struct from the
[`FontSystem`](https://docs.rs/cosmic-text/latest/cosmic_text/struct.FontSystem.html)
by using the `.db` method.
- From the `Database` struct we get the
[`FaceInfo`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html)
which the provides a method to get the family
names([`families`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html#structfield.families))
- The `families` function returns a tuple of Vec. The tuple consists of
the `String` containing the name and the
[`Language`](https://docs.rs/fontdb/0.16.1/fontdb/enum.Language.html)
struct.

*It is noted that for the `families` function, the first family is
always `English US` unless it is unavailable*

Since the empty function provided
[here](https://github.com/zed-industries/zed/blob/main/crates/gpui/src/platform/linux/text_system.rs#L75)
explicitly declares a `Vec<String>` as the return type so I am
prioritizing the `English US` font family unless advised otherwise by
the reviewer.

---------

Signed-off-by: Maharshi Basu <basumaharshi10@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-03 11:28:53 -08:00
Joel Selvaraj
6a6dbe3aa1
linux: wayland: implement cursor style handling (#8632)
Release Notes:

- Implemented cursor style changing in wayland


[zed_cursor_wayland.webm](https://github.com/zed-industries/zed/assets/12579216/cbc03f85-41c1-4687-88b5-2aa5612d7129)

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-03 11:28:20 -08:00
Ömer Sinan Ağacan
9095a6b04e
Replace todo calls with error values in linux/platform (#8531)
We currently use a mix of unimplemented methods with empty bodies and
`todo!()` calls in linux/platform.

`todo!()`s cause crashes in runtime with accidental key presses or
clicks.

To avoid this, this PR replaces `todo!()`s in linux/platform with error
values.

This helps when working on Zed itself, testing PRs etc.

Release Notes:

- N/A
2024-03-03 11:18:08 -08:00
白山風露
69e0474ebb
Windows gpui platform (#8490)
First implementation of gpui platform for Windows.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-03 10:53:22 -08:00
Marshall Bowers
fe04f69caf
Enable clippy::useless_conversion (#8767)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:22:55 -05:00