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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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.§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more