ZIm/crates/editor/src
Conrad Irwin d0e82b0538
Introduce "Near" block type (#28032)
A "Near" block acts similarly to a "Below" block, but can (if it's
height is <= one line height) be shown on the end of the preceding line
instead of adding an entire blank line to the editor.

You can test it out by pasting this into `go_to_diagnostic_impl` and
then press `F8`
```
        let buffer = self.buffer.read(cx).snapshot(cx);
        let selection = self.selections.newest_anchor();

        self.display_map.update(cx, |display_map, cx| {
            display_map.insert_blocks(
                [BlockProperties {
                    placement: BlockPlacement::Near(selection.start),
                    height: Some(1),
                    style: BlockStyle::Flex,
                    render: Arc::new(|_| {
                        div()
                            .w(px(100.))
                            .h(px(16.))
                            .bg(gpui::hsla(0., 0., 1., 0.5))
                            .into_any_element()
                    }),
                    priority: 0,
                }],
                cx,
            )
        });
        return;
```

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-04-04 17:37:42 -06:00
..
display_map Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
git Fix flickering when staging and unstaging files (#27931) 2025-04-02 17:43:48 +00:00
scroll chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
test Preserve cursor position when resetting excerpts (#27850) 2025-04-01 16:55:10 +00:00
actions.rs Allow to temporarily stop LSP servers (#28034) 2025-04-03 12:50:43 -06:00
blink_manager.rs Remove unneeded anonymous lifetimes from gpui::Context (#27686) 2025-03-28 19:26:30 +00:00
clangd_ext.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
code_context_menus.rs Use consistent ordering for popup menus (#27765) 2025-04-04 14:57:09 -06:00
display_map.rs Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
editor.rs Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
editor_settings.rs editor: Hide mouse cursor also for movements and selections (#27677) 2025-03-29 19:23:36 +05:30
editor_settings_controls.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
editor_tests.rs Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
element.rs Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
git.rs Project Diff 2 (#23891) 2025-02-03 13:18:50 -07:00
highlight_matching_bracket.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
hover_links.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
hover_popover.rs Restore direct use of the input text for Markdown Text (#27620) 2025-04-04 23:12:32 +00:00
indent_guides.rs Move "async move" a few characters to the left in cx.spawn() (#26758) 2025-03-19 02:09:02 +00:00
inlay_hint_cache.rs Preserve cursor position when resetting excerpts (#27850) 2025-04-01 16:55:10 +00:00
inline_completion_tests.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
items.rs Preserve cursor position when resetting excerpts (#27850) 2025-04-01 16:55:10 +00:00
jsx_tag_auto_close.rs jsx-tag-auto-close: Remove potential source of bugs and panics (#28119) 2025-04-04 19:01:08 +00:00
linked_editing_ranges.rs Move "async move" a few characters to the left in cx.spawn() (#26758) 2025-03-19 02:09:02 +00:00
lsp_ext.rs Fix remote clients unable to query custom, lsp_ext, commands (#27775) 2025-03-31 16:13:09 +00:00
mouse_context_menu.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
movement.rs Preserve cursor position when resetting excerpts (#27850) 2025-04-01 16:55:10 +00:00
persistence.rs Persist editor folds between restarts (#27252) 2025-03-21 15:28:11 +00:00
proposed_changes_editor.rs Preserve cursor position when resetting excerpts (#27850) 2025-04-01 16:55:10 +00:00
rust_analyzer_ext.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
scroll.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
selections_collection.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
signature_help.rs Use symmetric padding in signature popovers (#27734) 2025-04-01 14:14:33 +02:00
tasks.rs Improve Zed tasks' ZED_WORKTREE_ROOT fallbacks (#25605) 2025-02-26 22:30:31 +02:00
test.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00