Compare commits

...

55 Commits

Author SHA1 Message Date
Conrad Irwin
7773c7d1ca zed 0.119.20 2024-01-26 11:01:02 -07:00
Thorsten Ball
7cbce334c3 Fix panic when typing umlauts in command palette using Vim mode (#6761)
Release Notes:

- This fixes a panic that occurs when someone was using Vim mode and
typing umlauts into the command palette. E.g: `:%s/impërt`
2024-01-26 10:54:02 -07:00
Thorsten Ball
69c71018ee Upgrade alacritty_terminal in hopes to avoid PTY poll failing (#6715)
We saw stack traces in our #panic channel pop up that failed on this
line:

3330614219/alacritty_terminal/src/event_loop.rs (L323-L324)

With this message:

thread 'PTY reader' panicked at 'called `Result::unwrap()` on an `Err`
value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor"
}'

/Users/administrator/.cargo/git/checkouts/alacritty-afea874b09a502a5/3330614/alacritty_terminal/src/event_loop.rs:324

We don't know how to reproduce the error. It doesn't seem related to the
number of open PTY handles, because `openpty` itself didn't fail. We can
only assume that something went wrong between `openpty` and the setup of
the polling.

Since Alacritty itself changed its polling mechanism significantly by
switching from `mio` to `polling`
(https://github.com/alacritty/alacritty/pull/6846) we upgraded with the
hope that this will fix the bug.

Release Notes:

- Upgraded alacritty_terminal to newest version in order to hopefully
fix a rare panic that can occur when starting a new terminal.
2024-01-26 10:53:51 -07:00
Conrad Irwin
020eadc7a4 zed 0.119.19 2024-01-24 20:21:53 -07:00
Conrad Irwin
5f40ce5bbc Fix circular locking in prompts (#6456)
Sometimes Cocoa calls app delegate methods (notably the display link)
while we're calling Cocoa methods. This causes a deadlock unless we
are careful to run cocao methods while we're not holding our internal
locks

Release Notes:

- Fixed a crash when opening the MacOS Save As dialogue.
2024-01-24 20:15:22 -07:00
Conrad Irwin
d5d383c589 Use the correct snapshot when calculating mouse positions (#6453)
Release Notes:

- Fixed a panic in calculating remote cursor positions
2024-01-24 20:15:15 -07:00
Conrad Irwin
e59d7eb618 Fix crash in feedback modal (#6431)
After the general release we saw a number of crashes due to a SEGFAULT
inside the
System::new() method apparently relating to refreshing the user list.

As we do not need the user list, and the similar code in the telemtry
create is not crashing,
do less work for now.

Release Notes:

- Fixed a crash when opening the feedback modal
2024-01-24 20:15:08 -07:00
Mikayla
1981f3973e zed 0.119.18 2024-01-24 11:05:13 -08:00
Mikayla Maki
ba15d96ab6 Revert "Ensure that notify observations are sent during Window::draw()" (#6152)
Reverts zed-industries/zed#4236

This causes an infinite loop when opening the language server logs
2024-01-24 11:00:43 -08:00
Joseph T. Lyons
323fc8a313 v0.119.x stable 2024-01-24 10:54:20 -05:00
Joseph T. Lyons
a8ad67b233 Merge branch 'main' into v0.119.x 2024-01-24 10:22:55 -05:00
Joseph T. Lyons
cd099bcc01 zed 0.119.17 2024-01-24 10:22:21 -05:00
Joseph T. Lyons
7ff6c2dd2b zed 0.119.16 2024-01-22 16:47:39 -05:00
Joseph T. Lyons
5b34b775ca Merge branch 'main' into v0.119.x 2024-01-22 16:40:47 -05:00
Max Brunsfeld
d59ebac2fa zed 0.119.15 2024-01-18 15:36:49 -08:00
Max Brunsfeld
4b7ea172d7 Merge branch 'main' into v0.119.x 2024-01-18 15:34:33 -08:00
Joseph T. Lyons
2a7ccb5758 zed 0.119.14 2024-01-18 16:56:26 -05:00
Joseph T. Lyons
f148211b92 Merge branch 'main' into v0.119.x 2024-01-18 16:55:54 -05:00
Conrad Irwin
ae9178e034 zed 0.119.13 2024-01-18 13:38:36 -07:00
Conrad Irwin
09ff2a8353 Merge branch 'main' into v0.119.x 2024-01-18 13:37:22 -07:00
Joseph T. Lyons
d2d4319e44 zed 0.119.12 2024-01-18 14:31:39 -05:00
Joseph T. Lyons
66e2cf5671 Merge branch 'main' into v0.119.x 2024-01-18 14:28:39 -05:00
Joseph T. Lyons
528cb97bc5 Merge branch 'main' into v0.119.x 2024-01-18 13:05:43 -05:00
Joseph T. Lyons
bcf3476155 zed 0.119.11 2024-01-17 14:19:44 -05:00
Joseph T. Lyons
937c7019a0 Merge branch 'main' into v0.119.x 2024-01-17 14:19:12 -05:00
Joseph T. Lyons
4a95347087 zed 0.119.10 2024-01-17 12:27:36 -05:00
Joseph T. Lyons
9a9840533d Merge branch 'main' into v0.119.x 2024-01-17 12:26:45 -05:00
Joseph T. Lyons
df96b641d7 zed 0.119.9 2024-01-16 11:04:02 -05:00
Joseph T. Lyons
b0a1e25fbb Merge branch 'main' into v0.119.x 2024-01-16 11:03:05 -05:00
Joseph T. Lyons
9cb0a428f7 zed 0.119.8 2024-01-12 12:07:42 -05:00
Joseph T. Lyons
6084e22844 Fix panic with many participants (#4035)
Fix bug from first test

Release Notes:

- (Added|Fixed|Improved) ...
([#<public_issue_number_if_exists>](https://github.com/zed-industries/community/issues/<public_issue_number_if_exists>)).
2024-01-12 12:06:52 -05:00
Max Brunsfeld
76ff0f5fff zed 0.119.7 2024-01-11 17:16:03 -08:00
Max Brunsfeld
ed1c2bd29e Fix failure to write to keychain when signing in or failing to sign in (#4031)
Release Notes:

- Fixed an error where Zed would not save credentials to the keychain
after signing in.
2024-01-11 17:05:58 -08:00
Max Brunsfeld
d1e7ca8762 Temporarily avoid releasing livekit RemoteAudioTracks on drop (#4030)
This release call was added during the conversion to gpui2. I think it
is probably valid, but want to remove it on the off chance that it is
causing the crash that we're seeing in the `livekit.multicast` thread
when leaving a room.

Most likely, this is not going to fix anything, and is just introducing
a small memory leak, but it is a step back to how the app worked with
gpui 1.
2024-01-11 17:05:47 -08:00
Max Brunsfeld
d57dfba2fb Fix routing of leader updates from unshared projects (#4028)
Previously, leader updates in unshared projects would be sent to all
followers regardless of project, as if they were not scoped to any
project.

- Fixes a crash that could sometimes happen when following someone if
they were focused on an unshared project.
2024-01-11 17:05:15 -08:00
Joseph T. Lyons
3da4a78cb1 zed 0.119.6 2024-01-11 15:19:06 -05:00
Joseph T. Lyons
6c34c360f5 Merge branch 'main' into v0.119.x 2024-01-11 15:18:05 -05:00
Joseph T. Lyons
52eab41b7f zed 0.119.5 2024-01-10 15:28:34 -05:00
Joseph T. Lyons
497c42e941 Merge branch 'main' into v0.119.x 2024-01-10 15:27:02 -05:00
Joseph T. Lyons
f56f50da10 zed 0.119.4 2024-01-08 13:00:38 -05:00
Joseph T. Lyons
0f17fa8a61 Merge branch 'main' into v0.119.x 2024-01-08 12:58:55 -05:00
Max Brunsfeld
f5c2e15593 Restore the ability to disable key bindings by setting them to null in your keymap (#3921)
* Fix an incorrect use of `Any::type_id` that prevented the disabling of
key bindings
* Restructured the representation of disabled key bindings so that they
handle context predicates correctly. Previously, to disable key binding,
you needed to supply the exact same context predicate (e.g. `Editor &&
mode == "full"`) as the binding that you are trying to disable. Now, the
context predicates of disabled key bindings are evaluated just like any
other context predicate (with the current context) to see if they apply.

Release Notes:

- Fixed an issue where disabling key bindings didn't work. To disable a
key binding, set it to `null` in your keymap.
2024-01-05 13:53:08 -08:00
Joseph T. Lyons
1e4e2afb01 zed 0.119.3 2024-01-05 16:46:55 -05:00
Joseph T. Lyons
0f8c58fc6b Merge branch 'main' into v0.119.x 2024-01-05 16:45:53 -05:00
Joseph T. Lyons
c63e577cd3 zed 0.119.2 2024-01-04 18:41:32 -05:00
Joseph T. Lyons
26ed5247cc Merge branch 'main' into v0.119.x 2024-01-04 18:37:26 -05:00
Joseph T. Lyons
88f0dc7118 zed 0.119.1 2024-01-04 16:05:28 -05:00
Joseph T. Lyons
47f24f9ce2 Merge branch 'main' into v0.119.x 2024-01-04 16:04:36 -05:00
Max Brunsfeld
6335117966 Fix version comparison in auto update (#3889) 2024-01-04 13:01:41 -05:00
Antonio Scandurra
e8d01f40a4 Merge remote-tracking branch 'origin/main' into v0.119.x 2024-01-04 16:59:20 +01:00
Max Brunsfeld
6320316e5c Remove wasmtime for now 2024-01-03 17:58:06 -08:00
Mikayla
62315445cd Change binary name 2024-01-03 15:52:45 -08:00
Mikayla
a6da6581b9 Fix version 2024-01-03 13:59:05 -08:00
Joseph T. Lyons
d6cd48ae96 Merge branch 'main' into v0.119.x 2024-01-03 16:36:02 -05:00
Joseph T. Lyons
c2685051da v0.119.x preview 2024-01-03 13:27:00 -05:00
13 changed files with 211 additions and 349 deletions

243
Cargo.lock generated
View File

@@ -101,50 +101,25 @@ dependencies = [
"util",
]
[[package]]
name = "alacritty_config"
version = "0.1.2-dev"
source = "git+https://github.com/zed-industries/alacritty?rev=33306142195b354ef3485ca2b1d8a85dfc6605ca#33306142195b354ef3485ca2b1d8a85dfc6605ca"
dependencies = [
"log",
"serde",
"toml 0.7.8",
]
[[package]]
name = "alacritty_config_derive"
version = "0.2.2-dev"
source = "git+https://github.com/zed-industries/alacritty?rev=33306142195b354ef3485ca2b1d8a85dfc6605ca#33306142195b354ef3485ca2b1d8a85dfc6605ca"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
]
[[package]]
name = "alacritty_terminal"
version = "0.20.0-dev"
source = "git+https://github.com/zed-industries/alacritty?rev=33306142195b354ef3485ca2b1d8a85dfc6605ca#33306142195b354ef3485ca2b1d8a85dfc6605ca"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35229555d7cc7e83392dfc27c96bec560b1076d756184893296cd60125f4a264"
dependencies = [
"alacritty_config",
"alacritty_config_derive",
"base64 0.13.1",
"base64 0.21.4",
"bitflags 2.4.1",
"home",
"libc",
"log",
"mio 0.6.23",
"mio-anonymous-pipes",
"mio-extras",
"miow 0.3.7",
"nix 0.26.4",
"miow 0.6.0",
"parking_lot 0.12.1",
"regex-automata 0.1.10",
"piper",
"polling 3.3.2",
"regex-automata 0.4.5",
"rustix-openpty",
"serde",
"serde_yaml",
"signal-hook",
"signal-hook-mio",
"toml 0.7.8",
"unicode-width",
"vte",
"windows-sys 0.48.0",
@@ -444,7 +419,7 @@ dependencies = [
"futures-lite",
"log",
"parking",
"polling",
"polling 2.8.0",
"rustix 0.37.23",
"slab",
"socket2 0.4.9",
@@ -1155,7 +1130,7 @@ dependencies = [
"serde_json",
"syn 1.0.109",
"tempfile",
"toml 0.5.11",
"toml",
]
[[package]]
@@ -1514,7 +1489,7 @@ dependencies = [
"time",
"tokio",
"tokio-tungstenite",
"toml 0.5.11",
"toml",
"tonic",
"tower",
"tracing",
@@ -1599,7 +1574,7 @@ dependencies = [
"serde_json",
"settings",
"story",
"toml 0.5.11",
"toml",
"util",
"uuid 1.4.1",
]
@@ -2014,6 +1989,12 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "cursor-icon"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991"
[[package]]
name = "dashmap"
version = "5.5.3"
@@ -3597,7 +3578,7 @@ dependencies = [
"log",
"mime",
"once_cell",
"polling",
"polling 2.8.0",
"slab",
"sluice",
"tracing",
@@ -3937,12 +3918,6 @@ dependencies = [
"safemem",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linkme"
version = "0.3.17"
@@ -4299,19 +4274,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "mio-anonymous-pipes"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bc513025fe5005a3aa561b50fdb2cda5a150b84800ae02acd8aa9ed62ca1a6b"
dependencies = [
"mio 0.6.23",
"miow 0.3.7",
"parking_lot 0.11.2",
"spsc-buffer",
"winapi 0.3.9",
]
[[package]]
name = "mio-extras"
version = "2.0.6"
@@ -4324,17 +4286,6 @@ dependencies = [
"slab",
]
[[package]]
name = "mio-uds"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
dependencies = [
"iovec",
"libc",
"mio 0.6.23",
]
[[package]]
name = "miow"
version = "0.2.2"
@@ -4349,11 +4300,11 @@ dependencies = [
[[package]]
name = "miow"
version = "0.3.7"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
checksum = "359f76430b20a79f9e20e115b3428614e654f04fab314482fc0fda0ebd3c6044"
dependencies = [
"winapi 0.3.9",
"windows-sys 0.48.0",
]
[[package]]
@@ -4513,17 +4464,6 @@ dependencies = [
"libc",
]
[[package]]
name = "nix"
version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
dependencies = [
"bitflags 1.3.2",
"cfg-if 1.0.0",
"libc",
]
[[package]]
name = "nix"
version = "0.27.1"
@@ -5294,6 +5234,17 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "piper"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
dependencies = [
"atomic-waker",
"fastrand 2.0.0",
"futures-io",
]
[[package]]
name = "pkcs1"
version = "0.7.5"
@@ -5385,6 +5336,20 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "polling"
version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41"
dependencies = [
"cfg-if 1.0.0",
"concurrent-queue",
"pin-project-lite 0.2.13",
"rustix 0.38.21",
"tracing",
"windows-sys 0.52.0",
]
[[package]]
name = "pollster"
version = "0.2.5"
@@ -5461,7 +5426,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
dependencies = [
"toml 0.5.11",
"toml",
]
[[package]]
@@ -5568,7 +5533,7 @@ dependencies = [
"terminal",
"text",
"thiserror",
"toml 0.5.11",
"toml",
"unindent",
"util",
]
@@ -6039,6 +6004,17 @@ dependencies = [
"regex-syntax 0.7.5",
]
[[package]]
name = "regex-automata"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.2",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
@@ -6051,6 +6027,12 @@ version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "regex-syntax"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "remove_dir_all"
version = "0.5.3"
@@ -6428,11 +6410,23 @@ checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
dependencies = [
"bitflags 2.4.1",
"errno",
"itoa",
"libc",
"linux-raw-sys 0.4.12",
"windows-sys 0.48.0",
]
[[package]]
name = "rustix-openpty"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a25c3aad9fc1424eb82c88087789a7d938e1829724f3e4043163baf0d13cfc12"
dependencies = [
"errno",
"libc",
"rustix 0.38.21",
]
[[package]]
name = "rustls"
version = "0.19.1"
@@ -6901,15 +6895,6 @@ dependencies = [
"syn 2.0.37",
]
[[package]]
name = "serde_spanned"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"
dependencies = [
"serde",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
@@ -6922,18 +6907,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_yaml"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b"
dependencies = [
"indexmap 1.9.3",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "settings"
version = "0.1.0"
@@ -6955,7 +6928,7 @@ dependencies = [
"serde_json",
"serde_json_lenient",
"smallvec",
"toml 0.5.11",
"toml",
"tree-sitter",
"tree-sitter-json 0.19.0",
"unindent",
@@ -7061,18 +7034,6 @@ dependencies = [
"signal-hook-registry",
]
[[package]]
name = "signal-hook-mio"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af"
dependencies = [
"libc",
"mio 0.6.23",
"mio-uds",
"signal-hook",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
@@ -7263,12 +7224,6 @@ dependencies = [
"der",
]
[[package]]
name = "spsc-buffer"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be6c3f39c37a4283ee4b43d1311c828f2e1fb0541e76ea0cb1a2abd9ef2f5b3b"
[[package]]
name = "sqlez"
version = "0.1.0"
@@ -7942,7 +7897,7 @@ dependencies = [
"serde_json",
"settings",
"story",
"toml 0.5.11",
"toml",
"util",
"uuid 1.4.1",
]
@@ -8247,26 +8202,11 @@ dependencies = [
"serde",
]
[[package]]
name = "toml"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
]
[[package]]
name = "toml_datetime"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
@@ -8275,8 +8215,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
"indexmap 2.0.0",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
@@ -9098,10 +9036,12 @@ dependencies = [
[[package]]
name = "vte"
version = "0.11.1"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197"
checksum = "40eb22ae96f050e0c0d6f7ce43feeae26c348fc4dea56928ca81537cfaa6188b"
dependencies = [
"bitflags 2.4.1",
"cursor-icon",
"log",
"serde",
"utf8parse",
@@ -9675,15 +9615,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
[[package]]
name = "yansi"
version = "0.5.1"
@@ -9704,7 +9635,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.120.0"
version = "0.119.20"
dependencies = [
"activity_indicator",
"ai",
@@ -9793,7 +9724,7 @@ dependencies = [
"theme_selector",
"thiserror",
"tiny_http",
"toml 0.5.11",
"toml",
"tree-sitter",
"tree-sitter-bash",
"tree-sitter-c",

View File

@@ -567,7 +567,7 @@ impl EditorElement {
cx,
);
hover_at(editor, Some(point), cx);
Self::update_visible_cursor(editor, point, cx);
Self::update_visible_cursor(editor, point, position_map, cx);
}
None => {
update_inlay_link_and_hover_points(
@@ -592,9 +592,10 @@ impl EditorElement {
fn update_visible_cursor(
editor: &mut Editor,
point: DisplayPoint,
position_map: &PositionMap,
cx: &mut ViewContext<Editor>,
) {
let snapshot = editor.snapshot(cx);
let snapshot = &position_map.snapshot;
let Some(hub) = editor.collaboration_hub() else {
return;
};

View File

@@ -3,7 +3,7 @@ use gpui::AppContext;
use human_bytes::human_bytes;
use serde::Serialize;
use std::{env, fmt::Display};
use sysinfo::{System, SystemExt};
use sysinfo::{RefreshKind, System, SystemExt};
use util::channel::ReleaseChannel;
#[derive(Clone, Debug, Serialize)]
@@ -23,7 +23,7 @@ impl SystemSpecs {
.map(|v| v.to_string());
let release_channel = cx.global::<ReleaseChannel>().display_name();
let os_name = cx.app_metadata().os_name;
let system = System::new_all();
let system = System::new_with_specifics(RefreshKind::new().with_memory());
let memory = system.total_memory();
let architecture = env::consts::ARCH;
let os_version = cx

View File

@@ -136,25 +136,6 @@ impl Render for () {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {}
}
/// A quick way to create a [`Render`]able view without having to define a new type.
#[cfg(any(test, feature = "test-support"))]
pub struct TestView(Box<dyn FnMut(&mut ViewContext<TestView>) -> AnyElement>);
#[cfg(any(test, feature = "test-support"))]
impl TestView {
/// Construct a TestView from a render closure.
pub fn new<F: FnMut(&mut ViewContext<TestView>) -> AnyElement + 'static>(f: F) -> Self {
Self(Box::new(f))
}
}
#[cfg(any(test, feature = "test-support"))]
impl Render for TestView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
(self.0)(cx)
}
}
/// You can derive [`IntoElement`] on any type that implements this trait.
/// It is used to construct reusable `components` out of plain data. Think of
/// components as a recipe for a certain pattern of elements. RenderOnce allows

View File

@@ -534,67 +534,77 @@ impl Platform for MacPlatform {
&self,
options: PathPromptOptions,
) -> oneshot::Receiver<Option<Vec<PathBuf>>> {
unsafe {
let panel = NSOpenPanel::openPanel(nil);
panel.setCanChooseDirectories_(options.directories.to_objc());
panel.setCanChooseFiles_(options.files.to_objc());
panel.setAllowsMultipleSelection_(options.multiple.to_objc());
panel.setResolvesAliases_(false.to_objc());
let (done_tx, done_rx) = oneshot::channel();
let done_tx = Cell::new(Some(done_tx));
let block = ConcreteBlock::new(move |response: NSModalResponse| {
let result = if response == NSModalResponse::NSModalResponseOk {
let mut result = Vec::new();
let urls = panel.URLs();
for i in 0..urls.count() {
let url = urls.objectAtIndex(i);
if url.isFileURL() == YES {
if let Ok(path) = ns_url_to_path(url) {
result.push(path)
let (done_tx, done_rx) = oneshot::channel();
self.foreground_executor()
.spawn(async move {
unsafe {
let panel = NSOpenPanel::openPanel(nil);
panel.setCanChooseDirectories_(options.directories.to_objc());
panel.setCanChooseFiles_(options.files.to_objc());
panel.setAllowsMultipleSelection_(options.multiple.to_objc());
panel.setResolvesAliases_(false.to_objc());
let done_tx = Cell::new(Some(done_tx));
let block = ConcreteBlock::new(move |response: NSModalResponse| {
let result = if response == NSModalResponse::NSModalResponseOk {
let mut result = Vec::new();
let urls = panel.URLs();
for i in 0..urls.count() {
let url = urls.objectAtIndex(i);
if url.isFileURL() == YES {
if let Ok(path) = ns_url_to_path(url) {
result.push(path)
}
}
}
}
}
Some(result)
} else {
None
};
Some(result)
} else {
None
};
if let Some(done_tx) = done_tx.take() {
let _ = done_tx.send(result);
if let Some(done_tx) = done_tx.take() {
let _ = done_tx.send(result);
}
});
let block = block.copy();
let _: () = msg_send![panel, beginWithCompletionHandler: block];
}
});
let block = block.copy();
let _: () = msg_send![panel, beginWithCompletionHandler: block];
done_rx
}
})
.detach();
done_rx
}
fn prompt_for_new_path(&self, directory: &Path) -> oneshot::Receiver<Option<PathBuf>> {
unsafe {
let panel = NSSavePanel::savePanel(nil);
let path = ns_string(directory.to_string_lossy().as_ref());
let url = NSURL::fileURLWithPath_isDirectory_(nil, path, true.to_objc());
panel.setDirectoryURL(url);
let directory = directory.to_owned();
let (done_tx, done_rx) = oneshot::channel();
self.foreground_executor()
.spawn(async move {
unsafe {
let panel = NSSavePanel::savePanel(nil);
let path = ns_string(directory.to_string_lossy().as_ref());
let url = NSURL::fileURLWithPath_isDirectory_(nil, path, true.to_objc());
panel.setDirectoryURL(url);
let (done_tx, done_rx) = oneshot::channel();
let done_tx = Cell::new(Some(done_tx));
let block = ConcreteBlock::new(move |response: NSModalResponse| {
let mut result = None;
if response == NSModalResponse::NSModalResponseOk {
let url = panel.URL();
if url.isFileURL() == YES {
result = ns_url_to_path(panel.URL()).ok()
}
}
let done_tx = Cell::new(Some(done_tx));
let block = ConcreteBlock::new(move |response: NSModalResponse| {
let mut result = None;
if response == NSModalResponse::NSModalResponseOk {
let url = panel.URL();
if url.isFileURL() == YES {
result = ns_url_to_path(panel.URL()).ok()
}
}
if let Some(done_tx) = done_tx.take() {
let _ = done_tx.send(result);
if let Some(done_tx) = done_tx.take() {
let _ = done_tx.send(result);
}
});
let block = block.copy();
let _: () = msg_send![panel, beginWithCompletionHandler: block];
}
});
let block = block.copy();
let _: () = msg_send![panel, beginWithCompletionHandler: block];
done_rx
}
})
.detach();
done_rx
}
fn reveal_path(&self, path: &Path) {

View File

@@ -94,7 +94,6 @@ type AnyObserver = Box<dyn FnMut(&mut WindowContext) -> bool + 'static>;
type AnyWindowFocusListener = Box<dyn FnMut(&FocusEvent, &mut WindowContext) -> bool + 'static>;
#[derive(Debug)]
struct FocusEvent {
previous_focus_path: SmallVec<[FocusId; 8]>,
current_focus_path: SmallVec<[FocusId; 8]>,
@@ -2022,12 +2021,11 @@ impl<'a, V: 'static> ViewContext<'a, V> {
}
}
// Always emit a notify effect, so that handlers fire correctly
self.window_cx.app.push_effect(Effect::Notify {
emitter: self.view.model.entity_id,
});
if !self.window.drawing {
self.window_cx.window.dirty = true;
self.window_cx.app.push_effect(Effect::Notify {
emitter: self.view.model.entity_id,
});
}
}
@@ -2759,59 +2757,3 @@ pub fn outline(bounds: impl Into<Bounds<Pixels>>, border_color: impl Into<Hsla>)
border_color: border_color.into(),
}
}
#[cfg(test)]
mod test {
use std::{cell::RefCell, rc::Rc};
use crate::{
self as gpui, div, FocusHandle, InteractiveElement, IntoElement, Render, TestAppContext,
ViewContext, VisualContext,
};
#[gpui::test]
fn test_notify_on_focus(cx: &mut TestAppContext) {
struct TestFocusView {
handle: FocusHandle,
}
impl Render for TestFocusView {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
div().id("test").track_focus(&self.handle)
}
}
let notify_counter = Rc::new(RefCell::new(0));
let (notify_producer, cx) = cx.add_window_view(|cx| {
cx.activate_window();
let handle = cx.focus_handle();
cx.on_focus(&handle, |_, cx| {
cx.notify();
})
.detach();
TestFocusView { handle }
});
let focus_handle = cx.update(|cx| notify_producer.read(cx).handle.clone());
let _notify_consumer = cx.new_view({
|cx| {
let notify_counter = notify_counter.clone();
cx.observe(&notify_producer, move |_, _, _| {
*notify_counter.borrow_mut() += 1;
})
.detach();
}
});
cx.update(|cx| {
cx.focus(&focus_handle);
});
assert_eq!(*notify_counter.borrow(), 1);
}
}

View File

@@ -18,7 +18,7 @@ db = { path = "../db" }
theme = { path = "../theme" }
util = { path = "../util" }
alacritty_terminal = { git = "https://github.com/zed-industries/alacritty", rev = "33306142195b354ef3485ca2b1d8a85dfc6605ca" }
alacritty_terminal = "0.21"
procinfo = { git = "https://github.com/zed-industries/wezterm", rev = "5cd757e5f2eb039ed0c6bb6512223e69d5efc64d", default-features = false }
smallvec.workspace = true
smol.workspace = true

View File

@@ -1,5 +1,4 @@
use alacritty_terminal::term::color::Rgb as AlacRgb;
use alacritty_terminal::vte::ansi::Rgb as AlacRgb;
use gpui::Rgba;
//Convenience method to convert from a GPUI color to an alacritty Rgb
@@ -8,5 +7,5 @@ pub fn to_alac_rgb(color: impl Into<Rgba>) -> AlacRgb {
let r = ((color.r * color.a) * 255.) as u8;
let g = ((color.g * color.a) * 255.) as u8;
let b = ((color.b * color.a) * 255.) as u8;
AlacRgb::new(r, g, b)
AlacRgb { r, g, b }
}

View File

@@ -3,8 +3,6 @@ pub use alacritty_terminal;
pub mod terminal_settings;
use alacritty_terminal::{
ansi::{ClearMode, Handler},
config::{Config, Program, PtyConfig, Scrolling},
event::{Event as AlacTermEvent, EventListener, Notify, WindowSize},
event_loop::{EventLoop, Msg, Notifier},
grid::{Dimensions, Scroll as AlacScroll},
@@ -13,11 +11,11 @@ use alacritty_terminal::{
sync::FairMutex,
term::{
cell::Cell,
color::Rgb,
search::{Match, RegexIter, RegexSearch},
RenderableCursor, TermMode,
Config, RenderableCursor, TermMode,
},
tty::{self, setup_env},
vte::ansi::{ClearMode, Handler, NamedPrivateMode, PrivateMode, Rgb},
Term,
};
use anyhow::{bail, Result};
@@ -58,7 +56,6 @@ use gpui::{
};
use crate::mappings::{colors::to_alac_rgb, keys::to_esc_str};
use lazy_static::lazy_static;
actions!(
terminal,
@@ -75,15 +72,6 @@ const DEBUG_TERMINAL_HEIGHT: Pixels = px(30.);
const DEBUG_CELL_WIDTH: Pixels = px(5.);
const DEBUG_LINE_HEIGHT: Pixels = px(5.);
lazy_static! {
// Regex Copied from alacritty's ui_config.rs and modified its declaration slightly:
// * avoid Rust-specific escaping.
// * use more strict regex for `file://` protocol matching: original regex has `file:` inside, but we want to avoid matching `some::file::module` strings.
static ref URL_REGEX: RegexSearch = RegexSearch::new(r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`]+"#).unwrap();
static ref WORD_REGEX: RegexSearch = RegexSearch::new(r#"[\w.\[\]:/@\-~]+"#).unwrap();
}
///Upward flowing events, for changing the title and such
#[derive(Clone, Debug)]
pub enum Event {
@@ -289,66 +277,70 @@ impl TerminalBuilder {
pub fn new(
working_directory: Option<PathBuf>,
shell: Shell,
mut env: HashMap<String, String>,
env: HashMap<String, String>,
blink_settings: Option<TerminalBlink>,
alternate_scroll: AlternateScroll,
window: AnyWindowHandle,
) -> Result<TerminalBuilder> {
let pty_config = {
let pty_options = {
let alac_shell = match shell.clone() {
Shell::System => None,
Shell::Program(program) => Some(Program::Just(program)),
Shell::WithArguments { program, args } => Some(Program::WithArgs { program, args }),
Shell::Program(program) => {
Some(alacritty_terminal::tty::Shell::new(program, Vec::new()))
}
Shell::WithArguments { program, args } => {
Some(alacritty_terminal::tty::Shell::new(program, args))
}
};
PtyConfig {
alacritty_terminal::tty::Options {
shell: alac_shell,
working_directory: working_directory.clone(),
hold: false,
}
};
//TODO: Properly set the current locale,
env.insert("LC_ALL".to_string(), "en_US.UTF-8".to_string());
env.insert("ZED_TERM".to_string(), true.to_string());
// First, setup Alacritty's env
setup_env();
let alac_scrolling = Scrolling::default();
// alac_scrolling.set_history((BACK_BUFFER_SIZE * 2) as u32);
// Then setup configured environment variables
for (key, value) in env {
std::env::set_var(key, value);
}
//TODO: Properly set the current locale,
std::env::set_var("LC_ALL", "en_US.UTF-8");
std::env::set_var("ZED_TERM", "true");
let config = Config {
pty_config: pty_config.clone(),
env,
scrolling: alac_scrolling,
scrolling_history: 10000,
..Default::default()
};
setup_env(&config);
//Spawn a task so the Alacritty EventLoop can communicate with us in a view context
//TODO: Remove with a bounded sender which can be dispatched on &self
let (events_tx, events_rx) = unbounded();
//Set up the terminal...
let mut term = Term::new(
&config,
config,
&TerminalSize::default(),
ZedListener(events_tx.clone()),
);
//Start off blinking if we need to
if let Some(TerminalBlink::On) = blink_settings {
term.set_mode(alacritty_terminal::ansi::Mode::BlinkingCursor)
term.set_private_mode(PrivateMode::Named(NamedPrivateMode::BlinkingCursor));
}
//Alacritty defaults to alternate scrolling being on, so we just need to turn it off.
if let AlternateScroll::Off = alternate_scroll {
term.unset_mode(alacritty_terminal::ansi::Mode::AlternateScroll)
term.unset_private_mode(PrivateMode::Named(NamedPrivateMode::AlternateScroll));
}
let term = Arc::new(FairMutex::new(term));
//Setup the pty...
let pty = match tty::new(
&pty_config,
&pty_options,
TerminalSize::default().into(),
window.window_id().as_u64(),
) {
@@ -370,13 +362,16 @@ impl TerminalBuilder {
term.clone(),
ZedListener(events_tx.clone()),
pty,
pty_config.hold,
pty_options.hold,
false,
);
//Kick things off
let pty_tx = event_loop.channel();
let _io_thread = event_loop.spawn();
let _io_thread = event_loop.spawn(); // DANGER
let url_regex = RegexSearch::new(r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`]+"#).unwrap();
let word_regex = RegexSearch::new(r#"[\w.\[\]:/@\-~]+"#).unwrap();
let terminal = Terminal {
pty_tx: Notifier(pty_tx),
@@ -396,6 +391,8 @@ impl TerminalBuilder {
selection_phase: SelectionPhase::Ended,
cmd_pressed: false,
hovered_word: false,
url_regex,
word_regex,
};
Ok(TerminalBuilder {
@@ -514,7 +511,7 @@ impl Default for TerminalContent {
selection_text: Default::default(),
selection: Default::default(),
cursor: RenderableCursor {
shape: alacritty_terminal::ansi::CursorShape::Block,
shape: alacritty_terminal::vte::ansi::CursorShape::Block,
point: AlacPoint::new(Line(0), Column(0)),
},
cursor_char: Default::default(),
@@ -550,6 +547,8 @@ pub struct Terminal {
selection_phase: SelectionPhase,
cmd_pressed: bool,
hovered_word: bool,
url_regex: RegexSearch,
word_regex: RegexSearch,
}
impl Terminal {
@@ -760,7 +759,7 @@ impl Terminal {
let url_match = min_index..=max_index;
Some((url, true, url_match))
} else if let Some(word_match) = regex_match_at(term, point, &WORD_REGEX) {
} else if let Some(word_match) = regex_match_at(term, point, &mut self.word_regex) {
let maybe_url_or_path =
term.bounds_to_string(*word_match.start(), *word_match.end());
let original_match = word_match.clone();
@@ -777,7 +776,7 @@ impl Terminal {
(word_match, maybe_url_or_path)
};
let is_url = match regex_match_at(term, point, &URL_REGEX) {
let is_url = match regex_match_at(term, point, &mut self.url_regex) {
Some(url_match) => {
// `]` is a valid symbol in the `file://` URL, so the regex match will include it
// consider that when ensuring that the URL match is the same as the original word
@@ -1275,14 +1274,14 @@ impl Terminal {
pub fn find_matches(
&mut self,
searcher: RegexSearch,
mut searcher: RegexSearch,
cx: &mut ModelContext<Self>,
) -> Task<Vec<RangeInclusive<AlacPoint>>> {
let term = self.term.clone();
cx.background_executor().spawn(async move {
let term = term.lock();
all_search_matches(&term, &searcher).collect()
all_search_matches(&term, &mut searcher).collect()
})
}
@@ -1332,7 +1331,7 @@ impl EventEmitter<Event> for Terminal {}
/// Based on alacritty/src/display/hint.rs > regex_match_at
/// Retrieve the match, if the specified point is inside the content matching the regex.
fn regex_match_at<T>(term: &Term<T>, point: AlacPoint, regex: &RegexSearch) -> Option<Match> {
fn regex_match_at<T>(term: &Term<T>, point: AlacPoint, regex: &mut RegexSearch) -> Option<Match> {
visible_regex_match_iter(term, regex).find(|rm| rm.contains(&point))
}
@@ -1340,7 +1339,7 @@ fn regex_match_at<T>(term: &Term<T>, point: AlacPoint, regex: &RegexSearch) -> O
/// Iterate over all visible regex matches.
pub fn visible_regex_match_iter<'a, T>(
term: &'a Term<T>,
regex: &'a RegexSearch,
regex: &'a mut RegexSearch,
) -> impl Iterator<Item = Match> + 'a {
let viewport_start = Line(-(term.grid().display_offset() as i32));
let viewport_end = viewport_start + term.bottommost_line();
@@ -1362,7 +1361,7 @@ fn make_selection(range: &RangeInclusive<AlacPoint>) -> Selection {
fn all_search_matches<'a, T>(
term: &'a Term<T>,
regex: &'a RegexSearch,
regex: &'a mut RegexSearch,
) -> impl Iterator<Item = Match> + 'a {
let start = AlacPoint::new(term.grid().topmost_line(), Column(0));
let end = AlacPoint::new(term.grid().bottommost_line(), term.grid().last_column());

View File

@@ -11,12 +11,11 @@ use itertools::Itertools;
use language::CursorShape;
use settings::Settings;
use terminal::{
alacritty_terminal::ansi::NamedColor,
alacritty_terminal::{
ansi::{Color as AnsiColor, Color::Named, CursorShape as AlacCursorShape},
grid::Dimensions,
index::Point as AlacPoint,
term::{cell::Flags, TermMode},
vte::ansi::{Color as AnsiColor, Color::Named, CursorShape as AlacCursorShape, NamedColor},
},
terminal_settings::TerminalSettings,
IndexedCell, Terminal, TerminalContent, TerminalSize,
@@ -308,7 +307,7 @@ impl TerminalElement {
/// Converts the Alacritty cell styles to GPUI text styles and background color.
fn cell_style(
indexed: &IndexedCell,
fg: terminal::alacritty_terminal::ansi::Color,
fg: terminal::alacritty_terminal::vte::ansi::Color,
// bg: terminal::alacritty_terminal::ansi::Color,
colors: &Theme,
text_style: &TextStyle,
@@ -998,11 +997,11 @@ fn to_highlighted_range_lines(
}
/// Converts a 2, 8, or 24 bit color ANSI color to the GPUI equivalent.
fn convert_color(fg: &terminal::alacritty_terminal::ansi::Color, theme: &Theme) -> Hsla {
fn convert_color(fg: &terminal::alacritty_terminal::vte::ansi::Color, theme: &Theme) -> Hsla {
let colors = theme.colors();
match fg {
// Named and theme defined colors
terminal::alacritty_terminal::ansi::Color::Named(n) => match n {
terminal::alacritty_terminal::vte::ansi::Color::Named(n) => match n {
NamedColor::Black => colors.terminal_ansi_black,
NamedColor::Red => colors.terminal_ansi_red,
NamedColor::Green => colors.terminal_ansi_green,
@@ -1034,11 +1033,11 @@ fn convert_color(fg: &terminal::alacritty_terminal::ansi::Color, theme: &Theme)
NamedColor::DimForeground => colors.terminal_dim_foreground,
},
// 'True' colors
terminal::alacritty_terminal::ansi::Color::Spec(rgb) => {
terminal::alacritty_terminal::vte::ansi::Color::Spec(rgb) => {
terminal::rgba_color(rgb.r, rgb.g, rgb.b)
}
// 8 bit, indexed colors
terminal::alacritty_terminal::ansi::Color::Indexed(i) => {
terminal::alacritty_terminal::vte::ansi::Color::Indexed(i) => {
terminal::get_color_at_index(*i as usize, theme)
}
}

View File

@@ -280,7 +280,7 @@ fn generate_positions(string: &str, query: &str) -> Vec<usize> {
return positions;
};
for (i, c) in string.chars().enumerate() {
for (i, c) in string.char_indices() {
if c == current {
positions.push(i);
if let Some(c) = chars.next() {

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.120.0"
version = "0.119.20"
publish = false
license = "GPL-3.0-only"

View File

@@ -1 +1 @@
dev
stable