Commit Graph
48 Commits
Author SHA1 Message Date
Max Brunsfeld e6011794ca Remove AppState from workspace actions
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Nathan Sobo 472b313309 Put context parameter last in toggle_modal callback
This is more consistent with our treatment of context params everywhere else.
2022-05-10 16:46:53 -06:00
Antonio ScandurraandNathan Sobo 4729ab818d When opening items via project panel, only focus them on double-click
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-05 15:27:27 +02:00
Max Brunsfeld 3e9daa2377 Give hover state to picker items, keystrokes in command palette 2022-04-28 15:17:56 -07:00
Max Brunsfeld 3bcb97f912 Rename Selector -> Picker in theme 2022-04-28 14:45:32 -07:00
Antonio Scandurra e724671336 Add only one worktree when running zed /dir /dir/file 2022-04-22 11:06:17 +02:00
Max Brunsfeld 412d48c8b5 Update file finder correctly when project files change 2022-04-19 13:10:36 -07:00
Max Brunsfeld 04cbb7b727 Use Picker in Outline view 2022-04-18 17:11:39 -07:00
Max Brunsfeld 385ea15c1b Make all pickers respect mouse clicks 2022-04-18 17:11:39 -07:00
Max Brunsfeld 72580120eb Use Picker in FileFinder 2022-04-18 17:11:39 -07:00
Max Brunsfeld 700c1b2d50 Start work on a command palette 2022-04-18 17:11:08 -07:00
Max Brunsfeld ff345ba696 Load modal key bindings from JSON file 2022-04-10 11:39:43 -07:00
Max Brunsfeld 0908a8799c Allow actions to be deserialized from JSON
Introduce separate macro for implementing 'internal' actions which
are not intended to be loaded from keymaps.
2022-04-08 15:47:51 -07:00
0cf9925cb1 Restructure action macro to assign a namespace to every action
Also, allow arbitrary types to be used as Actions via the impl_actions macro

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:20:49 -07:00
Keith Simmons b6f15ecc50 Tab size is pulled properly from settings instead of hardcoded 2022-04-06 10:23:37 -07:00
Max BrunsfeldandKeith Simmons dce66e6f9e Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Nathan Sobo 81077f4361 Don't require a path in TestAppContext::dispatch_action
Instead, derive it from the presenter. This makes tests easier to write and more reliable since we'll be accurately simulating the actual relationship between parent and child views.
2022-04-05 12:08:25 -06:00
Antonio ScandurraandNathan Sobo 04d1c52456 Allow flex items to float to the end of the flex axis
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-30 16:46:14 +02:00
Antonio Scandurra a0ca4a13f8 Rename editor::Event::Edited to editor::Event::BufferEdited
This is to distinguish it from a new event we're about to add which
represent edits originating from that specific editor.
2022-03-24 08:55:46 +01:00
Antonio Scandurra 0de3f0980f Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Antonio ScandurraandNathan Sobo 53d7dfb195 Introduce workspace::register_project_item
This lets downstream crates like `editor` define how project items should be
opened.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:54:34 +01:00
Antonio ScandurraandNathan Sobo e158b79115 Rename app_state to global in gpui
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:33:01 +01:00
Antonio Scandurra e2c28d19d1 Finish refactoring of how editors are opened 2022-03-17 11:29:46 +01:00
Max Brunsfeld d2a4b6888c Store settings as a global via a gpui app_state 2022-03-11 15:58:58 -08:00
Keith Simmons 492eea86be formatting fixes 2022-03-09 10:42:27 -08:00
Keith Simmons ce49c2909b Make theme selector match other selector styling 2022-03-09 10:40:30 -08:00
Antonio ScandurraandMax Brunsfeld 819bf72dfc Rename weak to visible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-02 14:38:16 -08:00
Antonio Scandurra 79568c471a Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Max BrunsfeldandNathan Sobo 20d923b53e Provide editor styling information separately from editor settings
* Since regular editors' font sizes and families are controlled by
  the settings and not the theme, don't store a dummy text style in
  the theme. Instead, only store a font color, and synthesize
  the text style for regular editors using both the theme and the
  settings.
* Style single-line and auto-height editors (now called "field
  editors") using a single function that takes the entire theme and
  selects a relevant sub-object.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-24 16:42:00 -08:00
b485554e64 Take an Into<AnyViewHandle> in ChildView::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:54:45 +01:00
Max Brunsfeld 0bee9ad4f8 Merge branch 'project-diagnostics-pinned-tab' into style-project-diagnostics 2022-01-25 12:20:37 -08:00
Antonio Scandurra 41100c4439 Make add_local_worktree private and use find_or_create_local_worktree
The former always adds a worktree, even if we have one already in the
project and that could be misused. The public API should always search
for a local worktree containing the requested path first so that the
project can uphold invariants about which worktrees it has.
2022-01-22 11:23:00 +01:00
Antonio Scandurra ba96ca0b1b Remove weak worktrees from project when nobody references them
Also, avoid showing them in the project panel as well as in the
contacts panel.
2022-01-21 14:34:14 +01:00
e1bf476b29 Add select_first and select_last bindings to outline view
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 10:45:37 -08:00
6372b5908e Center the selected item when updating outline query
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 17:53:06 +01:00
Max BrunsfeldandNathan Sobo 024ffdeafe Show error+warning counts in project diagnostics tab
Allow workspace items' tab contents to be arbitrary elements

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 10:51:28 -08:00
Antonio ScandurraandNathan Sobo c28fd392cb Refactor opening workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:38:37 +01:00
Antonio ScandurraandNathan Sobo 7ebeddd2c2 WIP: Add keybinding to open buffers under cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 16:12:50 +01:00
Max BrunsfeldandNathan Sobo 6551baa91e Unify Flexible and Expanded elements
We'll use the name Expanded for something else now.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:29:34 -08:00
Max Brunsfeld f06eef084f Introduce a WorktreeId struct, fix incorrect use of remote worktrees' handle id 2022-01-04 11:28:44 +01:00
Max Brunsfeld a7b89e4e51 Correctly incorporate editor settings into diagnostic header rendering 2021-12-16 16:36:33 -08:00
Nathan SoboandMax Brunsfeld 33ac740f31 Group diagnostics by primary
Render primary message above the excerpt and supporting messages as block decorations with a `Below` disposition. This is still super rough.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 18:26:42 -07:00
Nathan SoboandMax Brunsfeld 93322a4858 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Max BrunsfeldandNathan Sobo ca11c68a19 Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 14:13:22 -08:00
Antonio Scandurra f1ef633508 Allow overriding editor settings on a per-language basis 2021-11-29 09:39:13 +01:00
Antonio ScandurraandNathan Sobo 69531cd8bf Invert dependency between editor and workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-24 17:07:16 +01:00
10f07a81a7 Skip autoclosed pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-06 19:04:55 +02:00
Antonio Scandurra ac46768302 Extract file_finder into its own crate 2021-10-05 14:30:56 +02:00