Commit Graph
23 Commits
Author SHA1 Message Date
Conrad Irwin d2ea8d8a91 Allow opening non-extant files (#9256)
Fixes #7400



Release Notes:

- Improved the `zed` command to not create files until you save them in
the editor ([#7400](https://github.com/zed-industries/zed/issues/7400)).
2024-03-12 22:30:04 -06:00
Conrad Irwin 2b8c42508f Add --add/--new to control CLI behaviour (#9202)
When neither is specified, if you open a directory you get a new
workspace, otherwise files are added to your existing workspace.

With --new files are always opened in a new workspace
With --add directories are always added to an existing workspace

Fixes #9076
Fixes #4861
Fixes #5370

Release Notes:

- Added `-n/--new` and `-a/--add` to the zed CLI. When neither is
specified, if you open a directory you get a new workspace, otherwise
files are added to your existing workspace. With `--new` files are
always opened in a new workspace, with `--add` directories are always
added to an existing workspace.
([#9076](https://github.com/zed-industries/zed/issues/9096),
[#4861](https://github.com/zed-industries/zed/issues/4861),
[#5370](https://github.com/zed-industries/zed/issues/5370)).
2024-03-12 14:27:58 -06:00
9ffa9707f4 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
Mikayla Maki 9bfe776b9b Remove todo! comments (#8981)
Switching fully to normal `todo` style

Release Notes:

- N/A
2024-03-06 18:25:20 -08:00
Nathan Sobo 2d7db2d1b8 Remove ! from todo!() in comments (#8643)
This practice makes it difficult to locate todo!s in my code when I'm
working. Let's take out the bang if we want to keep doing this.

Release Notes:

- N/A
2024-02-29 18:19:05 -07:00
白山風露 5f5601e06d CI: Enable clippy on Windows (#8240)
Release Notes:

- N/A
2024-02-23 16:23:42 -08:00
Kirill BulatovandMikayla Maki f51391eda3 Actually fail on clippy failures (#7619)
Before the change to `script/clippy`, bash ignored first `clippy`
invocation failure and CI moved on with Linux errors and warnings
emitted.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-09 10:13:00 -08:00
Conrad Irwin 9da086cfce Code to allow opening zed:/channel/1234
Refactored a bit how url arguments are handled to avoid adding too much
extra complexity to main.
2023-10-05 14:57:45 -07:00
Julia 5f1e58b1f9 Prevent duplicate instances by coordinating via a socket 2023-07-07 14:19:44 -04:00
Joseph Lyons 4b5a7ec94a Fix typos 2023-06-02 22:02:19 -04:00
Kirill Bulatov 01d344aaf4 Unit test file:row:column parsing 2023-05-16 21:07:48 +03:00
Kirill Bulatov 1508c39e5f Do not break Zed & Zed CLI compatibility 2023-05-16 21:07:47 +03:00
Kirill Bulatov a9d441ae5f Attempt to open rows and columns from CLI input 2023-05-16 21:07:26 +03:00
Kirill Bulatov 0708442690 Unify path:row:column parsing, use it in CLI 2023-05-16 21:07:26 +03:00
Kirill Bulatov 4103a3084f Allow CLI to start Zed from local sources
Zed now is able to behave as if it's being started from CLI
(`ZED_FORCE_CLI_MODE` env var)

Zed CLI accepts regular binary file path into `-b` parameter (only *.app before),
and tries to start it as Zed editor with `ZED_FORCE_CLI_MODE` env var
and other params needed.
2023-05-16 17:41:32 +03:00
Petros AmoiridisandMikayla 2ab6dea074 Create files passed as args to CLI
Co-Authored-by: Mikayla <mikayla@zed.dev>
2023-01-19 19:38:05 +02:00
Antonio ScandurraandNathan Sobo 387f450fa4 Locate app bundle based on location of CLI binary
The app bundle can also be specified via `-b` or `--bundle-path`.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:29:12 +02:00
Antonio ScandurraandNathan Sobo 41b7498c98 Implement zed --version
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:28:31 +02:00
Antonio Scandurra 6350760340 Implement zed --wait 2022-04-20 17:28:31 +02:00
Max Brunsfeld 8ae5bc4280 Locate the Zed app from the CLI using NSWorkspace API 2022-04-20 17:27:33 +02:00
Max BrunsfeldandAntonio Scandurra d3971f0899 Allow opening paths from the CLI
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-20 17:27:31 +02:00
Nathan SoboandMax Brunsfeld b7f0ff4dca Use ipc_channel crate to communicate between cli and app
We still aren't handling CLI requests in the app, but this lays the foundation for bi-directional communication.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-04-20 17:15:46 +02:00
Antonio ScandurraandNathan Sobo a49363b39e WIP: Start on a new cli crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:15:45 +02:00