Commit Graph
405 Commits
Author SHA1 Message Date
JuliaandAntonio Scandurra 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
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 BrunsfeldandNathan 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
Marshall Bowers f02a3e8c68 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 fcbc18a380 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 7f4d03fab2 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 3198eb6c6d Merge branch 'main' into splits 2023-12-11 10:16:32 -08:00
Marshall Bowers 6add17338c Style scrollbar when using diff markers 2023-12-11 12:58:55 -05:00
Marshall Bowers 89884d289f Pull scrollbar colors from theme 2023-12-11 12:47:29 -05:00
Conrad Irwin dd42adc4e5 Remove warnigns 2023-12-11 10:45:27 -07:00
Conrad Irwin b66b4915cf Merge branch 'main' into vim2 2023-12-11 09:38:23 -07:00
Piotr Osiewicz ddbd5cf2cb Merge branch 'main' into project_search2 2023-12-11 16:47:48 +01:00
Antonio Scandurra b4fc8ea6f7 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 3694265b6b Finalize the command 2023-12-11 12:28:22 +02:00
Kirill Bulatov e3fc810b3d Draft an expand macro recusively command 2023-12-11 12:28:22 +02:00
Antonio Scandurra e3c0b1f903 Listen for mouse events on scrollbar 2023-12-11 10:33:05 +01:00
Antonio Scandurra 03df63aa00 Merge remote-tracking branch 'origin/main' into scrollbars2 2023-12-11 09:51:43 +01:00
Conrad Irwin cea26c9d10 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 9ce7395b74 Restore impl_actions! and remove derive(Action) 2023-12-10 19:33:38 -07:00
Conrad Irwin 62d6a85a71 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 4290c67b6a 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 7b722c326f Paint code-action/fold buttons above the gutter 2023-12-09 11:41:40 -08:00
Conrad Irwin a4ea7bf928 More code written, similar lack of workingness so far 2023-12-08 17:45:17 -07:00