pub struct ContextMenuContext<'a> {
pub buffer: &'a EditorBuffer,
pub selection: Option<&'a Selection>,
pub cursor_offset: usize,
pub clicked_row: usize,
pub clicked_col: usize,
pub caps: ContextMenuCaps,
}Expand description
Read-only snapshot passed to hooks contributing menu items.
clicked_row / clicked_col are buffer coordinates of the right-click
(row = zero-based buffer row, col = source byte offset within that
line’s text, clamped to the line length) so hooks can offer
position-aware actions (e.g. “Toggle task checkbox” only on task lines).
Fields§
§buffer: &'a EditorBufferThe underlying text buffer (read-only for item contribution).
selection: Option<&'a Selection>The active selection range, if any.
cursor_offset: usizeCurrent cursor byte offset.
clicked_row: usizeZero-based buffer row that was right-clicked.
clicked_col: usizeSource byte offset within the clicked line that was right-clicked.
caps: ContextMenuCapsFrontend-supplied capabilities (clipboard, undo/redo availability).
Auto Trait Implementations§
impl<'a> Freeze for ContextMenuContext<'a>
impl<'a> RefUnwindSafe for ContextMenuContext<'a>
impl<'a> Send for ContextMenuContext<'a>
impl<'a> Sync for ContextMenuContext<'a>
impl<'a> Unpin for ContextMenuContext<'a>
impl<'a> UnsafeUnpin for ContextMenuContext<'a>
impl<'a> UnwindSafe for ContextMenuContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more