ZIm/crates/repl/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
..
components chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
kernels chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
notebook chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
outputs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
components.rs Show kernel options in a picker (#20274) 2024-11-07 17:59:53 -08:00
jupyter_settings.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
notebook.rs Initial Notebook UI structure (#19756) 2024-10-29 11:30:07 -07:00
outputs.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
repl.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
repl_editor.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
repl_sessions_ui.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
repl_store.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
session.rs Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00