Commit Graph

425 Commits

Author SHA1 Message Date
Kirill Bulatov
c6f3f439c4 Fix mouse listeners' z-index for editor 2023-12-23 01:55:40 +02:00
Kirill Bulatov
764a2755e2 Fix multibuffer scroll by reordering z-index of its elements
1. Blocks (with their headers) and mouse listeners should be drawn together otherwise either starts to loose mouse events.

2. Scrollbar should be above all to match zed1 look and avoid buffer headers popping slightly to the right of the scrollbar.
2023-12-22 22:56:35 +02:00
Antonio Scandurra
62aea418de
Fix panic in completions menu (#3778)
We were shifting all the positions while keeping the original string,
which caused problems later when combining highlighted ranges with
matched indices.

Release Notes:

- N/A
2023-12-22 12:27:52 +01:00
Antonio Scandurra
a551647ec1 Fix panic in completions menu
We were shifting all the positions while keeping the original
string, which caused problems later when combining highlighted
ranges with matched indices.
2023-12-22 12:12:39 +01:00
Kirill Bulatov
4d5ff77abe Fix the tests 2023-12-22 12:14:53 +02:00
Kirill Bulatov
d36ec81725 Move multibuffer "go to file" button into the buffer header
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-22 12:02:44 +02:00
Kirill Bulatov
fce31b7ddf Remove the warnings from element.rs 2023-12-22 12:02:44 +02:00
Marshall Bowers
3d1e52297e
Scale down status bar items (#3766)
This PR scales down the sizes of items in the status bar.

This brings us more in line with Zed1.

Release Notes:

- N/A
2023-12-21 17:42:54 -05:00
Nathan Sobo
4680aad885
Correctly compute placeholder text for buffer search query editor (#3749)
Rather than relying on the focused element, instead explicitly pass the
focus handle for the query editor when determining the prev/next
bindings. Only compute these values once.

Release Notes:

- N/A
2023-12-20 20:48:31 -07:00
Nathan Sobo
d499cccebb Only compute placeholder text once 2023-12-20 14:47:56 -07:00
Nathan Sobo
9acb5825e6 Compute the query editor placeholder text with a focus handle
So we're not beholden to the current focus.
2023-12-20 13:00:52 -07:00
Kirill Bulatov
75074c3297 Apply more fixes to the visual part 2023-12-20 18:23:08 +02:00
Antonio Scandurra
5781cf6604 Use InteractiveBounds everywhere we change the cursor style 2023-12-20 13:59:52 +01:00
Max Brunsfeld
71d17e268d
Fix layout of diagnostic blocks (#3729)
Previously, all of the lines in a multi-line error message were painted
on top of each other. I also simplified the logic for highlighting
backtick-enclosed ranges in a diagnostic message.
2023-12-19 15:49:56 -08:00
Max Brunsfeld
3fccc648d6 Fix layout of diagnostic blocks 2023-12-19 15:41:00 -08:00
Marshall Bowers
a0224b975b Use link_text_hover for go-to-definition links 2023-12-19 18:24:52 -05:00
Julia
ef39382c84
Allow editor mouse drag selection outside interactive bounds (#3716)
Release Notes:

- N/A
2023-12-19 13:07:31 -05:00
Julia
961f989388
Match zed1 scrollbar drag behavior (#3715)
Still not ideal, but we need to ship and this is more than reasonable

Release Notes:

- N/A
2023-12-19 13:00:26 -05:00
Julia
e08fc0bbc0 Allow editor mouse drag selection outside interactive bounds
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 13:00:21 -05:00
Julia
51396344a3 Match zed1 scrollbar drag behavior
Still not ideal, but we need to ship and this is more than reasonable

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 12:50:06 -05:00
Max Brunsfeld
e655d2434a Don't stop propagation on mouse move over editor gutter 2023-12-19 09:02:25 -08:00
Antonio Scandurra
b30fd3f574 Fix janky editor scrollbar dragging
We can receive multiple events before computing the next frame, and
in that case we want to compute a drag delta between the position for the
previous mouse event and the current one.
2023-12-19 15:32:42 +01:00
Marshall Bowers
5900b815e1
Remove unimplemented toggling for project search entries (#3695)
This PR removes the unimplemented toggling of search results in the
project search.

This is new functionality that didn't exist in Zed1, and it's likely
that we won't be adding it before launch, so removing it for now.

Release Notes:

-  N/A
2023-12-18 12:53:08 -05:00
Nate Butler
7af0edf5b6
Editor UI Cleanup (#3676)
[[PR Description]]

TODO: 
- [x] Style fold marker
- [x] Editor - Code action icon too large, should use muted color,
should have tooltip
- [ ] Style inline assistant
    - Prompt text gets cut off veritcally
- [x] Line height on inline assist editor isn't tall enough
- Nate: This is my fault due to the line height (relative: 1) we are
setting on non-buffer editors. I'll look into this.
- [ ] Style diagnostic hover (right now it's an opaque box on some
themes)
    - Nate: This needs status tints, we are working on it
- [ ] Hovering over a symbol shows a dialogue that appears underneath
the scroll-bar

Release Notes:

- N/A
2023-12-15 15:49:55 -05:00
Nate Butler
e71f2b49e8 Style fold control 2023-12-15 15:41:53 -05:00
Mikayla
b4135dd2f1
Fix editor mouse event dispatch 2023-12-15 10:26:41 -08:00
Nate Butler
4cb0f60779 Update size of code action indicator and show when active 2023-12-15 12:29:33 -05:00
Nate Butler
83525bf142 Revert change to single line editor height 2023-12-15 12:22:33 -05:00
Nate Butler
d13c1486da Update fold_indicator render 2023-12-15 12:09:06 -05:00
Kirill Bulatov
31ff7d40ed Adjust copy/paste buffer only on the copy error action trigger 2023-12-15 11:34:00 +02:00
Kirill Bulatov
a6403aad1a Remove extra nits, do not panic on clicking the buffer separator 2023-12-15 11:28:48 +02:00
Nathan Sobo
ad8165ae79 Rename draw2 -> draw_and_update_state 2023-12-14 17:20:27 -07:00
Nathan Sobo
02606d1fb9 Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 16:56:36 -07:00
Marshall Bowers
2b278e69f7 Use editor_foreground color in editor 2023-12-14 17:34:07 -05:00
Nathan Sobo
d13a21c238 Don't move in paint 2023-12-14 15:15:18 -07:00
Conrad Irwin
4e1b4c4390 Refactor editor to be more clear about stacking 2023-12-14 10:48:15 -07:00
Conrad Irwin
d8cb0e8a2a Fix z-indexes in editor element
* Ensure that scroll events from blocks scroll the editor
* Ensure that scroll bars show behind hover things
2023-12-14 10:36:16 -07:00
Mikayla
d88fc27b79
Merge branch 'main' into fix-splits-bugs 2023-12-13 18:29:48 -08:00
Marshall Bowers
057b235c56
Implement VisibleOnHover for IconButton (#3642)
This PR implements the `VisibleOnHover` trait for `IconButton`s.

I noticed that in a lot of places we were wrapping an `IconButton` in an
extra `div` just so we could call `visible_on_hover` on it. By
implementing the trait on `IconButton` directly it allows us to avoid
the interstitial `div` entirely.

Release Notes:

- N/A
2023-12-13 20:42:27 -05:00
Marshall Bowers
137e4e9251
Add .visible_on_hover helper method (#3639)
This PR adds a `.visible_on_hover` helper method that can be used to
make an element only visible on hover.

I noticed we were repeating this similar stanza in a bunch of different
spots:

```rs
some_element
    .invisible()
    .group_hover("", |style| style.visible())
``` 

so it seemed like a nice thing to factor out into a reusable utility.

Release Notes:

- N/A
2023-12-13 19:12:20 -05:00
Mikayla
bfbbec0b01
Add fluent quad API 2023-12-13 13:21:48 -08:00
Marshall Bowers
9a7de98242
Don't show empty documentation labels in completions menu (#3632)
This PR fixes an issue where we would sometimes have extra blank lines
in the completions menu.

This was due to some items including documentation labels that were
empty strings.

Release Notes:

- N/A
2023-12-13 14:15:03 -05:00
Conrad Irwin
a656d11fed Fix vim2 search tests 2023-12-12 18:39:42 -07:00
Max Brunsfeld
f5ca514bf0 Avoid notifying editor when wrap width changes
Wrap width is already assigned from within draw. It can be called multiple
times as taffy iteratively computes the layout.

Co-authored-by: Nathan <nathan@zed.dev>
2023-12-12 12:06:38 -08:00
Kirill Bulatov
27d6432c84 Rework the way project panel auto reveals entries
* gitignored entries are never auto revealed
* `project_panel::auto_reveal_entries = true` settings entry was added,
setting it to `false` will disable the auto reveal
* `pane::RevealInProjectPanel` action was added that activates the project panel and reveals the entry it got triggered on (including the gitignored ones)
2023-12-12 11:38:51 +02:00
Marshall Bowers
050ff6b27d
Adjust scrollbar track background and border colors (#3596)
This PR adjusts the colors we pull from the VS Code themes to use for
the scrollbar track background and border.

For the scrollbar track background we now use the `editor.background`,
and for the scrollbar track border we use `editorOverviewRuler.border`.

Release Notes:

- N/A
2023-12-11 17:08:39 -05:00
Conrad Irwin
d12eb0581a
vim2 (#3594)
- First round of vim tests

Add `observe_keystrokes` back to gpui2
Allow multiple actions to match a given key event

[[PR Description]]

Release Notes:

- (Added|Fixed|Improved) ...
([#<public_issue_number_if_exists>](https://github.com/zed-industries/community/issues/<public_issue_number_if_exists>)).
2023-12-11 15:06:51 -07:00
Marshall Bowers
aa27e1bcec Draw the scrollbar track left border 2023-12-11 16:39:00 -05:00
Mikayla Maki
927d18b0f3
Add support for resizing splits and docks, as well as utilities (#3595)
Making this PR to upstream changes to util and GPUI2, resizing exists
but isn't working yet.

Release Notes:

- N/A
2023-12-11 13:32:06 -08:00
Conrad Irwin
d1805d8ada First round of vim tests 2023-12-11 14:16:25 -07:00