Commit Graph
139 Commits
Author SHA1 Message Date
Antonio Scandurra edd758eb67 Cap context menu's width to cover at most 70% of the window 2022-06-16 10:40:12 +02:00
Antonio Scandurra 516bd13474 Add tooltip to follow collaborators 2022-06-15 17:08:39 +02:00
Antonio Scandurra f91fb48a4c Simplify EditorElement::layout_blocks 2022-06-10 13:57:43 +02:00
Antonio Scandurra 666ea61dbc Introduce a new BlockStyle field for blocks
This new field allows blocks to specify how they want to be laid out:

- If `Fixed` they can take up all the width they want and they will impact
the scroll width of the editor. This is useful for diagnostic messages and
allows scrolling the editor further to the right to visualize the entire message.
- If `Flex` they can extend all the way to the scroll width without impacting it
any further. This is useful for the rename editor that we insert as a block
decoration when hitting `F2`.
- If `Sticky`, they will be as wide as the editor element and won't participate
in the horizontal scrolling of the editor. This is useful for headers in general,
where we want e.g. the filename and the jump button to always be visible
independently of how much the user has scrolled to the right.
2022-06-10 13:47:40 +02:00
Keith Simmons b51bd87c10 Rework hover delay, respect editor font size, and enable hover in multibuffers 2022-06-09 17:03:44 -07:00
Antonio Scandurra ea8b5016f7 Snap overlay's bottom/right edge to same window's edge on overflow 2022-06-09 13:48:02 +02:00
Antonio Scandurra 712d47d94f Render a "Jump to Buffer" icon on all excerpt headers 2022-06-08 15:31:29 +02:00
Antonio Scandurra eda569d6b2 Snapshot file instead of path when creating a buffer snapshot 2022-06-08 14:29:14 +02:00
Keith Simmons 1b66e1e185 Add integration test and fix hovering over the wire 2022-06-07 14:22:02 -07:00
Keith Simmons a6c0ee472c Add vim bindings for hover
Allow scrolling in hover popover
2022-06-07 13:07:53 -07:00
Keith Simmons 67d9abc00f Move highlighting to editor code and implement proto message types for hover response 2022-06-07 11:54:52 -07:00
Keith Simmons c7cc07aafb working markdown rendering 2022-06-07 11:54:51 -07:00
Isaac Clayton d529a1deb4 Add basic debounce, fix flickering 2022-06-07 11:54:31 -07:00
Keith Simmons 560dff7329 Pull hover popover out of context menu 2022-06-07 11:54:00 -07:00
Isaac Clayton 24ad60a651 Add hover action and style context menu 2022-06-07 11:50:49 -07:00
Keith Simmons 0ed8a42bb4 WIP 2022-06-07 11:49:28 -07:00
Keith Simmons 0c4f798a2d WIP jump to definition with mouse 2022-06-07 11:47:23 -07:00
Antonio Scandurra 238827642a Align tooltip based on the available window space 2022-06-01 10:03:46 +02:00
Antonio Scandurra aefdde66a6 Pass a &mut BlockContext when rendering blocks
This wraps and derefs to `RenderContext<Editor>`, so that we can
easily use `MouseEventHandler`s in blocks.
2022-05-31 15:50:34 +02:00
Antonio Scandurra 20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Antonio Scandurra 9099c40364 Merge branch 'mouse-events' into project-panel-context-menu 2022-05-27 12:07:00 +02:00
Nathan SoboandMax Brunsfeld 2ea085b178 Pass a RenderContext to UniformList
In some cases, we need to render during layout. Previously, we were rendering with a LayoutContext in some cases, but this commit adds the ability to retrieve a render context with a given handle and we use that feature in UniformList.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:03:34 -06:00
Keith Simmons 8e7c6871db Track selection changes in mutable selections collection 2022-05-26 17:02:05 -07:00
Keith Simmons 61f0daa5c5 Visual line mode handles soft wraps 2022-05-26 17:02:05 -07:00
Keith Simmons 082036161f Enable copy and paste in vim mode 2022-05-26 17:02:05 -07:00
Keith Simmons f8f316cc64 Working change and delete in line mode 2022-05-26 17:02:05 -07:00
Keith Simmons d7d17b2148 WIP line mode operations 2022-05-26 17:02:05 -07:00
Nathan SoboandAntonio Scandurra 0866f0ed55 Introduce CursorRegion struct
This will blend in with an upcoming MouseRegion struct that sits next to it in the scene.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-26 11:00:10 -06:00
Nathan Sobo 6b96822c1a Fix editor tests 2022-05-26 09:59:25 +02:00
Keith Simmons bacfed37b7 Clone selections on editor split 2022-05-19 11:22:53 -07:00
Keith Simmons 45ea3d4c38 Review fixes 2022-05-13 15:55:27 -07:00
Keith Simmons de9dc27980 store buffer and display_map model handles on selections collection 2022-05-13 15:55:27 -07:00
Keith Simmons c9dcfff607 Move selection helpers to SelectionCollection, add update_anchor_selections, add a number of invariant preserving mutation functions to the MutableSelectionCollection 2022-05-13 15:55:17 -07:00
Antonio Scandurra 61346f734d WIP 2022-05-05 15:15:58 +02:00
Max BrunsfeldandAntonio Scandurra 8fdc5c9be3 Improve the appearance of project panel filename editor
* Always layout single-line editors with a fixed height
* Preserve directory chevron when editing folder names
* Allow theming the filename editor

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-05-04 10:28:44 -07:00
Nathan SoboandAntonio Scandurra 92f040df00 Apply cursor styles during paint
This makes the editor's cursor an IBeam and properly deals with nested cursor styles.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-22 10:54:18 -06:00
Antonio ScandurraandMax Brunsfeld 5081eafa9d Always wrap lines that are wider than 512 em advances
We went with a more conservative upper bound so that the number of
characters (hopefully) never exceeds `MAX_LINE_LEN` (1024) when laying
out text.

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-04-21 19:29:37 +02:00
Keith Simmons 292d075f81 Store accessors for editor highlight colors not colors themselves 2022-04-13 15:30:57 -07:00
Antonio Scandurra 73f2fd6b09 Pass visible bounds to Element::dispatch_event 2022-04-07 15:10:09 +02:00
Max BrunsfeldandKeith Simmons 866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Keith SimmonsandNathan Sobo 0aaf270650 Add clip_to_line_end to display_map/snapshot and set it to ensure vim positioning in normal mode
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:52 -07:00
Antonio Scandurra 34e5a1f6bb Always render local selections on top of remote ones 2022-03-22 10:31:28 +01:00
Max Brunsfeld 1728551282 Always mirror the leader's selections when following 2022-03-21 21:47:29 -07:00
Antonio ScandurraandNathan Sobo 44d997c00c Rename app_state to global in gpui
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:33:01 +01:00
Max Brunsfeld 76fc9c955e Restore underline for warnings about unused code 2022-03-15 13:13:33 -07:00
Antonio ScandurraandNathan Sobo 7155dabf5b Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Antonio Scandurra fbf7cdf4f2 Make all HighlightStyle properties optional
Previously, some of those properties such the font weight, style and color
would be mandatory: when the theme didn't specify them, Zed would use a default
value during deserialization. This meant that those default properties would
unconditionally override the base text style, causing a rendering bug when
combining syntax highlights with diagnostic styles.

This commit fixes that by making `HighlightStyle`s more additive: each property
can be set independently and only the properties that theme specifies get
overridden in the base text style.
2022-03-15 10:39:43 +01:00
Max BrunsfeldandAntonio Scandurra e392368d89 Fix layout panic on empty editors with blocks
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-14 12:03:26 -07:00
Max Brunsfeld b33a049958 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00
Nathan SoboandAntonio Scandurra 992fc07133 Hide selections in original editor when renaming
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-12 10:45:11 -07:00