Commit Graph
219 Commits
Author SHA1 Message Date
Antonio Scandurra 78403feee1 Return TextRuns in combine_syntax_and_fuzzy_match_highlights 2023-11-24 13:00:20 +01:00
Antonio Scandurra 0510d63b59 Introduce InteractiveText (#3397)
This new element will let us react to click events on arbitrary ranges
of some rendered text, e.g.:

```rs
InteractiveText::new(
    "element-id",
    StyledText::new("Hello world, how is it going?").with_runs(vec![
        cx.text_style().to_run(6),
        TextRun {
            background_color: Some(green()),
            ..cx.text_style().to_run(5)
        },
        cx.text_style().to_run(18),
    ]),
)
.on_click(vec![2..4, 1..3, 7..9], |range_ix, cx| {
    println!("Clicked range {range_ix}");
})
```

As part of this, I also added the ability to give text runs a background
color.

Release Notes:

- N/A
2023-11-23 19:35:03 +01:00
Antonio Scandurra 11117a43af Allow setting text background color via TextStyle 2023-11-23 19:22:18 +01:00
Kirill Bulatov 7e0e979c7b Allow to include gitignored files into project search (#3394) 2023-11-23 19:28:11 +02:00
Antonio Scandurra 8d1bfd142c Merge branch 'main' into rename-element-traits
# Conflicts:
#	crates/gpui2/src/elements/uniform_list.rs
#	crates/ui2/src/components/context_menu.rs
#	crates/ui2/src/components/list.rs
2023-11-23 12:47:46 +01:00
Kirill Bulatov 794007d171 Exclude more ignored/worktree-less/project-less buffers from inlay hint requests 2023-11-23 10:30:52 +02:00
Julia e3e29009bf zed2(ish) Cancel completion resolution when new list 2023-11-22 16:26:27 -05:00
Nathan Sobo d50a688a33 Reorganize element-related traits 2023-11-22 11:19:43 -07:00
Antonio Scandurra 496e54b117 Correctly swap position of context menu 2023-11-22 19:02:44 +01:00
Antonio Scandurra b2fa7da14d Track scroll in editor's context menu 2023-11-22 17:58:00 +01:00
Antonio Scandurra 9a8ba5cabe Don't perform wrapping in completions 2023-11-22 14:23:09 +01:00
Antonio Scandurra b2f147463a Avoid holding borrow to editor while painting child elements 2023-11-22 11:40:38 +01:00
Antonio Scandurra bdb99a4466 Merge branch 'main' into editor2-autocomplete
# Conflicts:
#	crates/editor2/src/editor.rs
2023-11-21 17:43:09 +01:00
Nate Butler 374d4b9557 TextColor -> Color 2023-11-21 01:05:29 -05:00
Piotr Osiewicz b05280f8cb Merge remote-tracking branch 'origin/callback-handles' into search2 2023-11-21 00:40:20 +01:00
42dfefd738 WIP
co-authored-by: conrad <conrad@zed.dev>
co-authored-by: Nathan <nathan@zed.dev>
2023-11-20 14:46:01 -08:00
Piotr Osiewicz 7629099e79 Merge branch 'main' into search2 2023-11-20 19:23:35 +01:00
Piotr Osiewicz 9fc3540a43 Merge branch 'main' into search2 2023-11-20 18:37:41 +01:00
Piotr Osiewicz ecfcfa158f fixup! Remove dbg statements 2023-11-20 18:35:39 +01:00
Piotr Osiewicz 79e6b0c127 Fix up tests once and for good 2023-11-20 18:24:37 +01:00
Conrad Irwin 7147bff519 Merge followup mess 2023-11-20 09:58:05 -07:00
Conrad Irwin 16cca67638 Merge branch 'main' into derive-element-redux 2023-11-20 09:15:38 -07:00
Joseph T. Lyons 2c70da8784 Restore commented-out code 2023-11-19 22:00:01 -05:00
Joseph T. Lyons e000d61ca8 Add timestamp delta to telemetry events 2023-11-19 21:52:28 -05:00
Nathan Sobo 42badd5d25 Clean compile with redesigned element traits 2023-11-18 21:51:47 -07:00
Nathan Sobo 346aa2f30f WIP 2023-11-18 20:22:43 -07:00
Nathan Sobo d2d1f1a1ff Element refinement passing on ui2 2023-11-18 20:05:47 -07:00
Nathan Sobo c2e152f730 Move self in Element::paint
Remove mutable state borrows in favor of state ownership in render processes to streamline element rendering.
2023-11-17 23:32:55 -07:00
Nate Butler 61027a4183 Use muted color for fold indicators 2023-11-18 01:02:40 -05:00
Julia 9a986fc6ab Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
Julia 5ded1aa46f Get diagnostic2 tests building and running 2023-11-17 16:32:35 -05:00
Julia 393a0dd154 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
JuliaandNathan Sobo 77947a8b50 Get diagnostics view almost building in the zed2 world
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-17 16:32:35 -05:00
Piotr Osiewicz 9cd550e2b7 Merge branch 'main' into search2 2023-11-17 13:22:30 +01:00
Antonio Scandurra b9e3ba496a Merge branch 'main' into editor2-autocomplete 2023-11-17 11:03:25 +01:00
Mikayla f4a1bc8622 Merge branch 'main' into saving-2 2023-11-16 23:11:38 -08:00
Mikayla 5a3ab9b226 Restore a bunch of random workspace stuff 2023-11-16 23:05:28 -08:00
Nathan Sobo d9fc569a64 Separate WrappedLines from ShapedLines (#3350)
ShapedLines are never wrapped, whereas WrappedLines are optionally
wrapped if they are associated with a wrap width. Originally, when
rewriting GPUI, I tried to combine everything because wrapping is
inherently optional for the Text element, but we have a bunch of APIs
that don't make sense on a line that may wrap, so we need a distinct
type for that case.

This is a precursor to implementing clickable links in markdown. I
noticed multiple places where we were confused about whether or not the
line was wrapped so this felt important.

Release Notes:

- N/A
2023-11-16 23:20:35 -07:00
Nathan Sobo 3ebf361f18 Separate WrappedLines from ShapedLines
ShapedLines are never wrapped, whereas WrappedLines are optionally wrapped if
they are associated with a wrap width. I tried to combine everything because
wrapping is inherently optional for the Text element, but we have a bunch of
APIs that don't make sense on a line that may wrap, so we need a distinct type
for that case.
2023-11-16 23:10:51 -07:00
Mikayla Maki 57062bcbc5 Actions‽ (#3349)
This PR re-implements our actions with macros instead of a blanket impl.

Release Notes:

- N/A
2023-11-16 18:18:04 -08:00
Mikayla f103ff66a1 Add default derive 2023-11-16 17:39:05 -08:00
Mikayla a3c156c5a5 Re-implement actions as derive macros instead of blanket impls 2023-11-16 17:32:02 -08:00
Nate Butler e9189b9096 Add ui_font settings and set default rem size accordingly (#3346)
[[PR Description]]
- Adds ui_font_family, ui_font_features, ui_font_size to settings and
default settings
- Use the new ui font settings to set the rem size when the workspace is
created.

Release Notes:

- N/A
2023-11-16 15:40:33 -05:00
Marshall Bowers 89cd4ac842 Parameterize theme2::init to allow loading just the base theme (#3345)
This PR adds a parameter to the `theme2::init` method to indicate what
the theme-loading behavior should be.

This allows us to indicate when we want to load all of the additional
built-in user themes (like in the Zed binary and in the storybook), and
when we don't want to load the user themes (like in tests).

We're using an enum over just a `bool` here for clarity at the call
site.

Release Notes:

- N/A
2023-11-16 13:03:30 -05:00
Nate ButlerandMarshall Bowers 3894669cf2 Remove todo
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-16 11:42:23 -05:00
Nate ButlerandMarshall Bowers 4f9f0ce53c Allow users to set UI font properties in their settings
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-16 11:37:46 -05:00
Piotr Osiewicz 7315c187bf Merge branch 'main' into search2 2023-11-16 17:16:15 +01:00
Antonio Scandurra 71786a07b0 Start rendering autocompletion menu 2023-11-16 14:55:06 +01:00
Kirill Bulatov 79249fbc7f WIP 2023-11-16 10:40:02 +02:00
Mikayla 37e6d07ba7 Merge branch 'main' into tabs-n-splits 2023-11-15 23:41:25 -08:00