pub enum BufferDisplayPreference {
Default,
PopupCentered,
PopupCursor,
FloatingCursor,
ActivePane,
SplitHorizontal,
SplitVertical,
}Expand description
User-facing override for a BufferDisplay. Each
BufferDisplayCategory gets a typed option keyed
<category>.display whose value is one of these variants;
the App’s resolver maps the variant to the matching
BufferDisplay. Default means “use the built-in default
for this category” — the fallback when the user hasn’t
set the option explicitly.
Flat (non-parametric) shape so the typed-options system
can store + parse it as one scalar; the parametric
BufferDisplay variants (Popup(PopupPlacement),
Split(SplitOrientation)) are flattened here as
PopupCentered / PopupCursor / SplitHorizontal /
SplitVertical.
Slice 3c.unify.option-docs-builtin migrated this enum
to labeled_enum! — adding a new display preference is
now one line; label / parse_label / doc / all are
derived automatically.
Variants§
Default
The implicit value when no override has been set.
PopupCentered
Centred focused popup (focus moves into the popup).
Accepts popup as an alias of popup-centered.
PopupCursor
Focused popup anchored at the cursor.
FloatingCursor
Doc keeps focus, popup auto-dismisses on cursor
motion (the hover shape). floating is the canonical
short alias.
ActivePane
Swap the buffer into the active pane. Alias pane.
SplitHorizontal
Horizontal split (new pane below). Aliases split,
split-horizontal.
SplitVertical
Vertical split (new pane beside). Alias split-vertical.
Implementations§
Source§impl BufferDisplayPreference
impl BufferDisplayPreference
Source§impl BufferDisplayPreference
impl BufferDisplayPreference
Sourcepub fn resolve(self, category: BufferDisplayCategory) -> BufferDisplay
pub fn resolve(self, category: BufferDisplayCategory) -> BufferDisplay
Map to the concrete BufferDisplay for the given
category. Default falls through to
default_display; any explicit variant returns its
fixed shape.
§Examples
use lattice_core::ui::display::{
BufferDisplay, BufferDisplayCategory, BufferDisplayPreference,
};
// No override: hover keeps its built-in floating popup.
assert_eq!(
BufferDisplayPreference::Default.resolve(BufferDisplayCategory::Hover),
BufferDisplay::FLOATING_CURSOR,
);
// `:set lsp.log.display=split` — the alias parses, then resolves.
let pref = BufferDisplayPreference::parse_label("split")
.unwrap_or_default();
assert_eq!(
pref.resolve(BufferDisplayCategory::LspLog),
BufferDisplay::SPLIT_HORIZONTAL,
);Trait Implementations§
Source§impl Clone for BufferDisplayPreference
impl Clone for BufferDisplayPreference
Source§fn clone(&self) -> BufferDisplayPreference
fn clone(&self) -> BufferDisplayPreference
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 BufferDisplayPreference
Source§impl Debug for BufferDisplayPreference
impl Debug for BufferDisplayPreference
Source§impl Default for BufferDisplayPreference
impl Default for BufferDisplayPreference
Source§fn default() -> BufferDisplayPreference
fn default() -> BufferDisplayPreference
impl Eq for BufferDisplayPreference
Source§impl PartialEq for BufferDisplayPreference
impl PartialEq for BufferDisplayPreference
impl StructuralPartialEq for BufferDisplayPreference
Auto Trait Implementations§
impl Freeze for BufferDisplayPreference
impl RefUnwindSafe for BufferDisplayPreference
impl Send for BufferDisplayPreference
impl Sync for BufferDisplayPreference
impl Unpin for BufferDisplayPreference
impl UnsafeUnpin for BufferDisplayPreference
impl UnwindSafe for BufferDisplayPreference
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.