Commit graph

14244 commits

Author SHA1 Message Date
Antonio Scandurra
8ac8a6f1d9 Re-enable most of the functionalities in editor2 2023-11-08 11:30:32 +01:00
Nate Butler
31bac3dd62 Document ColorScaleSteps 2023-11-08 00:45:05 -05:00
Nathan Sobo
d67581875f
Register actions statically / globally (#3264)
This updates our approach to action registration to make it
static/global.

There are 3 different approaches to creating an action, depending on the
complexity of your action's implementation. All of them involve defining
a data type with the correct trait implementations and registering it,
each a bit more powerful / verbose.

* Define a simple list of unit structs that implement `Action` -
`actions!(Foo, Bar, Baz)`
* Make a more complex data type into an action with `#[action]`. This
derives all the necessary traits and registers the action.
  ```rs
  #[action]
  struct MoveLeft {
    word: true
  }
  ```
* Implement all traits yourself and just register the action with
`#[register_action]`.

Release Notes:

N/A
2023-11-07 22:05:59 -07:00
Nathan Sobo
408edaae39 Remove call to removed method 2023-11-07 21:58:46 -07:00
Nathan Sobo
1949fa5147 Merge remote-tracking branch 'origin/main' into register-actions 2023-11-07 21:56:08 -07:00
Nathan Sobo
2a55b0dbfb Simplify actions macro. 2023-11-07 21:48:47 -07:00
Nathan Sobo
fdc9ea7f9b Docs and cleanup 2023-11-07 21:26:51 -07:00
Nathan Sobo
814e62050c Register actions globally before main 2023-11-07 20:58:37 -07:00
Nathan Sobo
80630cd4d9 WIP 2023-11-07 20:23:02 -07:00
Nate Butler
776338d27a
Update default theme player colors and add players story (#3263)
[[PR Description]]

- Update the default theme player colors for `Zed Pro Moonlight` and
`Zed Pro Daylight`
- Adds the ability to create stories in the `theme2` crate


![image](https://github.com/zed-industries/zed/assets/1714999/61fca222-1512-43b1-a229-fae1080d07fa)

You can see them by running:
- `cargo run -p storybook2 -- components/players --theme "Zed Pro
Daylight"`
- `cargo run -p storybook2 -- components/players --theme`

The player colors crisscross back and forth on the color wheel so that
the colors are as distinct as possible.


![image](https://github.com/zed-industries/zed/assets/1714999/255c9fd2-34da-4f75-9aad-0dd02f7009bf)

We do have room to add additional players if needed. Just let me know if
we feel like the default 8 aren't cutting it.


Release Notes:

- N/A
2023-11-07 22:00:49 -05:00
Nate Butler
0dd6ea6d41 Add new default player colors and the players story. 2023-11-07 21:51:12 -05:00
Nate Butler
79b4f78cb3 Extend the theme crate to enable stories, add players story 2023-11-07 21:08:33 -05:00
Nate Butler
a39865b4b2 Update default player colors 2023-11-07 20:27:00 -05:00
Max Brunsfeld
06960df287 Implement basic fuzzy filtering in picker 2023-11-07 17:24:04 -08:00
Max Brunsfeld
bdec1c8202 Merge branch 'main' into picker 2023-11-07 16:57:47 -08:00
Max Brunsfeld
bcc92e9c4e
Implement basic text input handling (#3262)
This PR adds basic text input to Editors in zed2.

Note that we have *not* yet implemented the
`InputHandler::bounds_for_range` method on `Editor`, so the composition
and emoji picker windows are not yet positioned correctly.
2023-11-07 16:57:26 -08:00
Max Brunsfeld
9fe3073af7 Get basic text input working
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 16:33:02 -08:00
Max Brunsfeld
bd12e3edb6 Assign editors as text input handlers
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 15:44:00 -08:00
Conrad Irwin
b2ae08b159 Implement an InputHandler trait for gpui2
Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Julia <julia@zed.dev>
2023-11-07 16:30:04 -07:00
Conrad Irwin
7cdece4857 Beautiful go to line modal
Co-authored-by: Julia <julia@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 15:32:34 -07:00
Max Brunsfeld
ea603401e2 Get actions + focus working on picker, now that it's a view
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 13:48:32 -08:00
Conrad Irwin
ae2d0f1fa1 Merge branch 'main' into go-to-line3 2023-11-07 14:44:45 -07:00
Conrad Irwin
5751303ea4 MOAR CODE 2023-11-07 14:44:36 -07:00
Max Brunsfeld
36d9633f6f Merge branch 'main' into picker 2023-11-07 13:37:49 -08:00
Max Brunsfeld
b9d051eae7 Start work on adding a filter editor to the picker
Implement picker as a view instead of as a component

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 13:37:10 -08:00
Conrad Irwin
ffce5ff084 Don't generate licenses on every PR 2023-11-07 14:33:19 -07:00
Conrad Irwin
9cdfce4956
Make it possible to render a single line editor (#3259)
[[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-11-07 14:26:10 -07:00
Nate Butler
3a85beeaa5 center a div 2023-11-07 16:23:41 -05:00
Conrad Irwin
5c450843a5 Add text and focus to editor 2023-11-07 14:19:15 -07:00
Conrad Irwin
a21c49c015 Make it possible to render a single line editor 2023-11-07 14:05:23 -07:00
Max Brunsfeld
80e6427eec 🎨
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-11-07 13:03:36 -08:00
Conrad Irwin
acab2f9003 MODAL 2023-11-07 13:23:27 -07:00
Max Brunsfeld
10c94cc8b7 Remove unused import 2023-11-07 11:47:49 -08:00
Mikayla Maki
a3bd04fed2
Merge branch 'main' into picker 2023-11-07 11:44:02 -08:00
Mikayla Maki
c7f5888348
editor singleline (#3257)
- Implement Editor::single_line
- Fix confusing error message
- Fix loading keyfiles
- Wire up GoToLine modal
2023-11-07 11:41:33 -08:00
Max Brunsfeld
d690fb038d Merge branch 'main' into picker 2023-11-07 11:27:14 -08:00
Nate Butler
b692fb1464
Start documenting ThemeColors (#3258)
[[PR Description]]
- Adds doc comments for most fields on ThemeColors
- Scaffolds out some upcoming additional fields (Will add in a later PR)
- Renames a few fields:
    - `element_placeholder` -> `element_placeholder_text`
    - `element_drop_target` -> `drop_target_background`
- Removes the redundant `element_placeholder_text` (This should be set
using `text_placeholder`

Release Notes:

- N/A
2023-11-07 14:14:56 -05:00
Conrad Irwin
1e6a0f1c7b Wire up GoToLine modal 2023-11-07 12:12:05 -07:00
Conrad Irwin
0233864e92 Fix loading keyfiles 2023-11-07 12:04:37 -07:00
Conrad Irwin
b804b25c21 Fix confusing error message 2023-11-07 12:04:21 -07:00
Nate Butler
df84ba4222 Continue documenting theme colors 2023-11-07 14:04:09 -05:00
Max Brunsfeld
6928ad1335 Rename List -> UniformList
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-11-07 11:00:53 -08:00
Max Brunsfeld
2412873719 Remove commented-out code in picker2
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-11-07 10:53:59 -08:00
Max Brunsfeld
742180a3a8 Implement list scroll tracking
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-11-07 10:45:38 -08:00
Nate Butler
eb5fe3a3b9 Merge branch 'main' into document-theme 2023-11-07 13:36:08 -05:00
Nate Butler
91f356a2f1 Begin documenting theme colors 2023-11-07 13:36:01 -05:00
Conrad Irwin
3a72f2122a Implement Editor::single_line 2023-11-07 11:12:36 -07:00
Antonio Scandurra
4bf3a4e3d4
Implement movement in editor2 (#3256)
Release Notes:

- N/A
2023-11-07 19:12:09 +01:00
Conrad Irwin
c89d6eb292
modals2 (#3247)
New Modal implementation for gpui2

Release Notes:

N/A
2023-11-07 10:56:46 -07:00
Antonio Scandurra
aa17adaac9 Merge remote-tracking branch 'origin/main' into editor-movement 2023-11-07 18:50:43 +01:00