Commit Graph
404 Commits
Author SHA1 Message Date
Antonio Scandurra d1817197d6 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 4b59ded300 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 dd03f4aaa0 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 54e65e465a Style fold control 2023-12-15 15:41:53 -05:00
Mikayla 118894f502 Fix editor mouse event dispatch 2023-12-15 10:26:41 -08:00
Nate Butler 103bddafd6 Update size of code action indicator and show when active 2023-12-15 12:29:33 -05:00
Nate Butler 6a78cd7bc6 Revert change to single line editor height 2023-12-15 12:22:33 -05:00
Nate Butler 5407216c11 Update fold_indicator render 2023-12-15 12:09:06 -05:00
Kirill Bulatov 26292d4df2 Adjust copy/paste buffer only on the copy error action trigger 2023-12-15 11:34:00 +02:00
Kirill Bulatov 8a5c5a5707 Remove extra nits, do not panic on clicking the buffer separator 2023-12-15 11:28:48 +02:00
Nathan Sobo bde23a78d3 Rename draw2 -> draw_and_update_state 2023-12-14 17:20:27 -07:00
Nathan Sobo 88f0572bad Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 16:56:36 -07:00
Marshall Bowers 3fbef5ff2c Use editor_foreground color in editor 2023-12-14 17:34:07 -05:00
Nathan Sobo 336acd490e Don't move in paint 2023-12-14 15:15:18 -07:00
Conrad Irwin 1640668f61 Refactor editor to be more clear about stacking 2023-12-14 10:48:15 -07:00
Conrad Irwin da8b21382b 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 626ed06f86 Merge branch 'main' into fix-splits-bugs 2023-12-13 18:29:48 -08:00
Marshall Bowers 45a30238e9 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 9d2708c71e 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 de754ed76f Add fluent quad API 2023-12-13 13:21:48 -08:00
Marshall Bowers 1a2584222c 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 0f92e4ec83 Fix vim2 search tests 2023-12-12 18:39:42 -07:00
Max BrunsfeldandNathan a51f3fe894 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 ab027aa72e 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 cf46241ea0 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 8aaf5eab9a 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 23d774a230 Draw the scrollbar track left border 2023-12-11 16:39:00 -05:00
Mikayla Maki b49faf2673 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 287fdcbf9e First round of vim tests 2023-12-11 14:16:25 -07:00
Marshall Bowers 53b76a6dd2 Fix inactive tab styles (the verbose way) (#3591)
This PR fixes the inactive tab style to properly show the label using
the muted text color.

I went about fixing this in the most direct way possible, but the
solution leaves a lot to be desired, IMO. I plan to explore some ideas
on how we can improve the state of styling the tab content without
having the same styles repeated all over the place and subsequently
out-of-sync.

Release Notes:

- N/A
2023-12-11 15:42:17 -05:00
Conrad Irwin 547c4cebb8 vim-flight entertainment (#3574)
- vim2 compiling (but mostly commented out)
- More code written, similar lack of workingness so far

Still todo:
[ ] Figure out the focus/blur stuff
[ ] Uncoment more code
[ ] Fix VimTestContext
[ ] Uncomment the tests

Release Notes:

- N/A
2023-12-11 12:11:13 -07:00
Marshall Bowers d83c40c77f Fix color for selections in scrollbar (#3590)
This PR fixes an issue where we weren't using the right color for
displaying selections within the scrollbar.

Release Notes:

- N/A
2023-12-11 13:34:29 -05:00
Mikayla fa73bc8748 Merge branch 'main' into splits 2023-12-11 10:16:32 -08:00
Marshall Bowers b1330f68e8 Style scrollbar when using diff markers 2023-12-11 12:58:55 -05:00
Marshall Bowers f294387f7d Pull scrollbar colors from theme 2023-12-11 12:47:29 -05:00
Conrad Irwin 3ae69b7596 Remove warnigns 2023-12-11 10:45:27 -07:00
Conrad Irwin 0d96e964ef Merge branch 'main' into vim2 2023-12-11 09:38:23 -07:00
Piotr Osiewicz ba57516632 Merge branch 'main' into project_search2 2023-12-11 16:47:48 +01:00
Antonio Scandurra 0d2780b508 Fix porting mistake that caused clicking on the editor to misbehave
We used `width` instead of `height` in the "pixels-to-point" conversion
code, which would cause clicks to not work correctly when the width was
smaller than the `y` coordinate.
2023-12-11 14:21:55 +01:00
Kirill Bulatov 42acd6431f Finalize the command 2023-12-11 12:28:22 +02:00
Kirill Bulatov 50e2f5c886 Draft an expand macro recusively command 2023-12-11 12:28:22 +02:00
Antonio Scandurra 135c16c158 Listen for mouse events on scrollbar 2023-12-11 10:33:05 +01:00
Antonio Scandurra 5eec1221cb Merge remote-tracking branch 'origin/main' into scrollbars2 2023-12-11 09:51:43 +01:00
Conrad Irwin 44a660dc78 actions3 (#3578)
- Restore impl_actions! and remove derive(Action)

Originally in gpui2 we inferred the action's namespace from the module
it was
defined in. This worked most of the time (ignoring the "remove_the_2"
hack),
but caused unintended (and mostly invisible) behavior in crates with
multiple
modules.

#3577 restored the namespace parameter to actions!, and this PR
reintroduces
`impl_actions!` to do the same for non-unit structs.

I considered trying to keep the struct-attribute API work, because it
does feel
more stylistically appropriate for rust, but two problems lead to it
feeling less good than `impl_actions!` in practice:
1. You have to repeat the namespace for each struct (and usually you're
defining them all in the same namespace)
2. You can't pass an argument to a derive macro inline, you need to use
an attribute instead.


Release Notes:

- N/A
2023-12-10 19:59:53 -07:00
Conrad Irwin aed17f4763 Restore impl_actions! and remove derive(Action) 2023-12-10 19:33:38 -07:00
Conrad Irwin 9761adb159 Restore namespace parameter to actions! (#3577)
This does not yet fix `derive(Action)`, but will conflict with a lot so
wanted to merge quickly.

Although automatically deriving the namespace worked in many situations,
it was
unclear what to do with nested modules. Vim wanted all actions to be
registered
under vim, while collab_ui wanted one namespace per action.

It seems better to make the implicit explicit, and give the flexibility
to hide
implementation details from the end-users.

Release Notes:

- N/A
2023-12-09 15:27:17 -07:00
Conrad Irwin 9befa3f9ca Restore namespace parameter to actions!
This does not yet fix `derive(Action)`, but will conflict with a lot so
wanted to merge quickly.
2023-12-09 15:18:31 -07:00
Max Brunsfeld b72f66fae8 Paint code-action/fold buttons above the gutter 2023-12-09 11:41:40 -08:00
Conrad Irwin 9f467fba9f More code written, similar lack of workingness so far 2023-12-08 17:45:17 -07:00
Mikayla 70c64c8a3f Add back semi-funcitonal pane resizing code 2023-12-08 16:29:42 -08:00