pub struct FormFieldHost { /* private fields */ }Expand description
Host adapter mounted on every text field’s Editor. Mirrors
hjkl_engine::DefaultHost but lives in this crate so consumers
can reach it without the default feature gating.
Implementations§
Source§impl FormFieldHost
impl FormFieldHost
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a field host with a one-row default viewport. The
renderer overwrites width / height per frame from the field’s
body rect.
Sourcepub fn cursor_shape(&self) -> CursorShape
pub fn cursor_shape(&self) -> CursorShape
Most recent cursor shape requested by the engine.
Trait Implementations§
Source§impl Default for FormFieldHost
impl Default for FormFieldHost
Source§impl Host for FormFieldHost
impl Host for FormFieldHost
Source§type Intent = ()
type Intent = ()
Custom intent type. Hosts that don’t fan out actions back to
themselves can use the unit type via the default impl approach
(set associated type explicitly).
Source§fn write_clipboard(&mut self, text: String)
fn write_clipboard(&mut self, text: String)
Fire-and-forget clipboard write. Engine never blocks; the host
queues internally and flushes on its own task (OSC52,
wl-copy,
pbcopy, …).Source§fn read_clipboard(&mut self) -> Option<String>
fn read_clipboard(&mut self) -> Option<String>
Returns the last-known cached clipboard value. May be stale —
matches the OSC52/wl-paste model neovim and helix both ship.
Source§fn now(&self) -> Duration
fn now(&self) -> Duration
Monotonic time. Multi-key timeout (
timeoutlen) resolution
reads this; engine never reads Instant::now() directly so
macro replay stays deterministic.Source§fn prompt_search(&mut self) -> Option<String>
fn prompt_search(&mut self) -> Option<String>
Synchronously prompt the user for a search pattern. Returning
None aborts the search.Source§fn emit_cursor_shape(&mut self, shape: CursorShape)
fn emit_cursor_shape(&mut self, shape: CursorShape)
Engine emits this on every mode transition. Hosts repaint the
cursor in the requested shape.
Source§fn emit_intent(&mut self, _intent: Self::Intent)
fn emit_intent(&mut self, _intent: Self::Intent)
Host-defined event the engine raises (LSP request, fold op,
buffer switch, …).
Source§fn viewport(&self) -> &Viewport
fn viewport(&self) -> &Viewport
Borrow the host’s viewport. The host writes
width/height/
text_width/wrap per render frame; the engine reads/writes
top_row / top_col to scroll. 0.0.34 (Patch C-δ.1) moved
this off hjkl_buffer::View onto Host.Source§fn viewport_mut(&mut self) -> &mut Viewport
fn viewport_mut(&mut self) -> &mut Viewport
Mutable viewport access. Engine motion + scroll code routes
here when scrolloff math advances
top_row.Source§fn should_cancel(&self) -> bool
fn should_cancel(&self) -> bool
Cooperative cancellation. Engine polls during long search /
regex / multi-cursor edit loops. Default returns
false.Source§fn display_line_for(&self, pos: Pos) -> u32
fn display_line_for(&self, pos: Pos) -> u32
Map a logical position to its display line for
gj/gk. Hosts
without wrapping may use the default identity impl.Auto Trait Implementations§
impl Freeze for FormFieldHost
impl RefUnwindSafe for FormFieldHost
impl Send for FormFieldHost
impl Sync for FormFieldHost
impl Unpin for FormFieldHost
impl UnsafeUnpin for FormFieldHost
impl UnwindSafe for FormFieldHost
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