pub enum PopupPlacement {
CursorAnchored,
Centered,
MinibufferBand,
}Expand description
Where the popup overlay anchors on screen.
Cursor-anchored popups (hover, signature help, diagnostic-at-
cursor) sit adjacent to the symbol that triggered them so the
user’s eye doesn’t have to leave the cursor to read them.
Centred popups are command-launched and unrelated to where the
cursor happens to be (:lsp-status, :describe-*, :apropos,
:help, :keymap, :options, :ls, :lsp-log, …) so
anchoring next to the cursor would produce a visually arbitrary
placement. Centring puts them where the eye lands by default.
Variants§
CursorAnchored
Anchor adjacent to the document cursor (above / below depending on screen room).
Centered
Centre over the buffer area.
MinibufferBand
Full width of the active pane, anchored to its bottom edge. Which-key’s placement.
Bottom-anchored full-width is what emacs which-key and
which-key.nvim both do, and per the UX-convention rule that
muscle memory is the default worth keeping. It is also the only
placement where the column count is predictable, which is what
lets the grid be laid out ahead of the renderer.
Height is content + border, hard-capped at half the pane so the hint can never swallow the buffer it is describing.
Slice: WK.5.
Trait Implementations§
Source§impl Clone for PopupPlacement
impl Clone for PopupPlacement
Source§fn clone(&self) -> PopupPlacement
fn clone(&self) -> PopupPlacement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PopupPlacement
Source§impl Debug for PopupPlacement
impl Debug for PopupPlacement
Source§impl Default for PopupPlacement
impl Default for PopupPlacement
Source§fn default() -> PopupPlacement
fn default() -> PopupPlacement
impl Eq for PopupPlacement
Source§impl PartialEq for PopupPlacement
impl PartialEq for PopupPlacement
impl StructuralPartialEq for PopupPlacement
Auto Trait Implementations§
impl Freeze for PopupPlacement
impl RefUnwindSafe for PopupPlacement
impl Send for PopupPlacement
impl Sync for PopupPlacement
impl Unpin for PopupPlacement
impl UnsafeUnpin for PopupPlacement
impl UnwindSafe for PopupPlacement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.