Commit Graph
39175 Commits
Author SHA1 Message Date
Mikayla Maki fcfbc7b810 Fix two mouse event bugs (#2835)
This PR fixes two bugs we discovered in Zed's mouse event handling while
investigating an interesting and mysterious bug we we were seeing, where
spurious `MouseMoved` events would continuously be dispatched after
control-clicking.

Release Notes:

- Fixed a rendering glitch that could occur after control-clicking
certain elements.
2023-08-09 09:04:32 -07:00
Piotr Osiewicz d131cc0324 Add cycle mode command for buffer search 2023-08-09 18:02:21 +02:00
Mikayla 54153f0b59 Fix selections and enter-to-create-file 2023-08-09 08:54:24 -07:00
Nate Butler 635662fc42 Add ui_sans as a font option in the theme (#2836)
This adds IBM Plex as a font option available to use as `ui_sans`

Note: This PR adds a static list of accepted font types in `/font`, as
LICENSE files were causing the app to crash when Zed was trying to load
them as fonts.

Release Notes:

- N/A (No user facing changes)

Thanks @ForLoveOfCats for getting me unstuck ❤️
2023-08-09 11:54:05 -04:00
Nate Butler 28c56c1f81 Add IBM Plex license 2023-08-09 11:39:15 -04:00
Nate ButlerandJulia 8bd9e72673 Only load TTF fonts for now, additional font types will need to be manually added
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-09 11:38:02 -04:00
Nate ButlerandJulia 8a4340c85e Remove license causing unwrap error
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-09 11:11:57 -04:00
Nate Butler f3741bcfeb WIP add IBM Plex Sans
(base) natebutler@Nate16 zed % cargo run
   Compiling zed v0.99.0 (/Users/natebutler/Code/zed/zed/crates/zed)
    Finished dev [unoptimized + debuginfo] target(s) in 9.15s
     Running `target/debug/Zed`
Thread "main" panicked with "called `Result::unwrap()` on an `Err` value: parse error" at crates/zed/src/main.rs:667:10
   0: backtrace::backtrace::libunwind::trace
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/libunwind.rs:93:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:176:9
   3: backtrace::capture::Backtrace::new
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:140:22
   4: Zed::init_panic_hook::{{closure}}
             at crates/zed/src/main.rs:436:29
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic_handler::{{closure}}
   7: std::sys_common::backtrace::__rust_end_short_backtrace
   8: _rust_begin_unwind
   9: core::panicking::panic_fmt
  10: core::result::unwrap_failed
  11: core::result::Result<T,E>::unwrap
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/core/src/result.rs:1089:23
  12: Zed::load_embedded_fonts
             at crates/zed/src/main.rs:664:5
  13: Zed::main
             at crates/zed/src/main.rs:80:5
  14: core::ops::function::FnOnce::call_once
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/core/src/ops/function.rs:250:5
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/sys_common/backtrace.rs:134:18
  16: std::rt::lang_start::{{closure}}
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/rt.rs:166:18
  17: std::panicking::try
  18: std::rt::lang_start_internal
  19: std::rt::lang_start
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/rt.rs:165:17
  20: _mai
2023-08-09 11:01:20 -04:00
Piotr Osiewicz 10d7ef81bc Reset search index on mode change 2023-08-09 14:25:56 +02:00
Piotr Osiewicz 395b5b6d5c buffer: Add magnifying glass icon 2023-08-09 13:47:48 +02:00
Piotr Osiewicz 08a4f3482c chore: update fn paint 2023-08-09 12:33:14 +02:00
Piotr Osiewicz a5f96dade0 Merge branch 'main' into project_search_design 2023-08-09 12:30:48 +02:00
Piotr Osiewicz 8d914b4332 Go back to previous mode on rejection of semantic indexing 2023-08-09 12:28:15 +02:00
Nathan Sobo 22acd64aa8 Rename node to frame 2023-08-08 21:28:52 -06:00
Nathan Sobo 2ac55ed691 Merge branch 'main' into cells 2023-08-08 21:23:57 -06:00
Nathan Sobo f38f79b209 Pass PaintContext to Element::paint (#2788)
I want to use this on another branch, but it's a sweeping change, so
this prepares the ground for it. This can always be reverted if it
doesn't work out.
2023-08-08 21:16:57 -06:00
Joseph T. Lyons 4e874b1140 Fix language detection when file name begins with a . (#2833)
I went to add in `zprofile` to the bash language config to get syntax
highlighting for it. After adding it in, Zed was still not highlighting
the file. I checked and saw that we are using `Path::extension()` in
`language_for_file()`, which [returns `None` when a file's name begins
with a
`.`](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.extension),
such as in the case of `.zprofile`. This PR adds a custom method, with
some tests, that just tries to grab the last component in the file name
if `Path::extension` returns `None`. Not sure if `ext` is the best name,
but I can't use `extension`.

Maybe this method should be called `extension_or_hidden_file_name()`?

Release Notes:

- Fixed a bug where language detection would fail for files starting
with `.` in their names.
- Added syntax highlighting for `.zprofile` files
2023-08-08 21:48:56 -04:00
Joseph T. Lyons 9024511498 Fix code that identifies language via extension 2023-08-08 21:35:11 -04:00
Max BrunsfeldandMikayla 0805e01c69 Use Arc::make_mut in ChannelStore
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-08 17:49:29 -07:00
Max BrunsfeldandMikayla f52071229f Terminate synthetic drag state on mouse up w/ ctrl held
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-08 17:39:45 -07:00
Max BrunsfeldandMikayla 586d7cbb6c Fix failure to remove hovered region_ids on element removal
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-08 17:39:05 -07:00
Nathan Sobo ba8c733d80 Merge remote-tracking branch 'origin/main' into paint-context 2023-08-08 18:27:16 -06:00
Nathan Sobo e1dfc8e3ce Replace context methods that take a window id with methods on window handles (#2832)
With this PR, I've eliminated almost all references to window ids
outside of the internals of GPUI. All public methods taking these ids
are now defined on `AnyWindowHandle`, which provides a more coherent
narrative around windows as a concept.
2023-08-08 17:51:37 -06:00
Piotr Osiewicz 392465c608 fix dismiss tooltip for project search 2023-08-09 01:37:17 +02:00
Piotr Osiewicz fb3dc3a587 chore: remove unused function 2023-08-09 01:30:45 +02:00
Piotr Osiewicz e364754ed2 buffer: use shared func for nav button rendering 2023-08-09 01:29:22 +02:00
Nathan Sobo ee9ba10e80 Rename mac platform Window to MacWindow for clarity 2023-08-08 17:21:06 -06:00
Nathan Sobo 78c6e537d5 Use AppContext::update when updating windows so we handle effects 2023-08-08 17:20:46 -06:00
Piotr Osiewicz 0c4511e71a chore: fix compiler warnings 2023-08-09 01:16:24 +02:00
Piotr Osiewicz 557ace7e71 Do not display match count when query is empty 2023-08-09 01:15:17 +02:00
Piotr Osiewicz a2006f33e9 buffer: finish up moving things around 2023-08-09 01:09:07 +02:00
Piotr Osiewicz 3495f0d203 buffer: WIP style sides of buffer search 2023-08-09 00:38:50 +02:00
Nathan Sobo bc83f1788b Minimize window id usage 2023-08-08 16:38:46 -06:00
Piotr Osiewicz e9c3d21ddd buffer: use icons for search options 2023-08-09 00:16:12 +02:00
Nathan Sobo f0132c19a9 Store AnyWindowHandles instead of usizes 2023-08-08 16:06:53 -06:00
Mikayla 647f724c30 Position and style the channel editor correctly
Fix a bug where some channel updates would be lost
Add channel name sanitization before storing in the database
2023-08-08 14:06:29 -07:00
Mikayla 23628aaf3f Position and style the channel editor correctly
Fix a bug where some channel updates would be lost
Add channel name sanitization before storing in the database
2023-08-08 12:46:13 -07:00
Piotr Osiewicz 128890db7c Piotr/optimize search selections with a limit (#2831)
/cc @nathansobo @maxbrunsfeld 

Release Notes:
- Fixed scrollbar selections causing noticeable slowdowns with large
quantities of selections.
2023-08-08 21:29:24 +02:00
Mikayla e377b3dedc Fix a bug where channel invitations would show up in the channels section
Block non-members from reading channel information
WIP: Make sure Arc::make_mut() works
2023-08-08 11:47:13 -07:00
Mikayla 6324f2fb6c Fix positioning on face piles, fix panic on member invite removal 2023-08-08 10:44:44 -07:00
Nathan Sobo 7b5fe99570 Merge remote-tracking branch 'origin/main' into window-handles 2023-08-08 11:42:55 -06:00
Nathan Sobo 7416197a6e Return window handles from WeakItemHandle 2023-08-08 11:39:56 -06:00
Nathan Sobo 79da4b18a4 Move more window methods off AsyncAppContext 2023-08-08 11:38:07 -06:00
Nathan Sobo 3c7e84d573 Move debug_elements to AnyWindowHandle 2023-08-08 11:27:19 -06:00
Nathan Sobo 0b2865203b Remove window methods from AsyncAppContext 2023-08-08 11:23:49 -06:00
Nathan Sobo 11c1e225a0 Remove AsyncAppContext::remove_window 2023-08-08 11:22:43 -06:00
Nathan Sobo 729a5abbeb Remove unused dock code 2023-08-08 11:20:42 -06:00
Nathan Sobo f01d3b87e0 Remove more window id usage 2023-08-08 11:20:09 -06:00
Nathan Sobo e293985af9 Work with window handles instead of ids in drag code 2023-08-08 11:14:02 -06:00
Nathan Sobo c843749cb0 Store an AnyWindowHandle in WindowContext 2023-08-08 11:08:37 -06:00