Skip to main content

StateChanges

Struct StateChanges 

Source
pub struct StateChanges {
Show 23 fields pub mode_changed: bool, pub cursor_moved: bool, pub selection_changed: bool, pub buffer_modified: bool, pub modified_buffers: Vec<BufferId>, pub modified_buffer_edits: Vec<(BufferId, Modification)>, pub affected_buffers: Vec<BufferId>, pub buffers_created: Vec<BufferId>, pub buffers_deleted: Vec<BufferId>, pub buffers_renamed: Vec<(BufferId, String)>, pub window_changed: bool, pub windows_created: Vec<WindowId>, pub windows_closed: Vec<WindowId>, pub focus_changed: bool, pub option_changed: bool, pub options_changed: Vec<OptionChange>, pub scroll_changed: bool, pub scrolled_windows: Vec<WindowId>, pub presence_changed: bool, pub presence_updates: Vec<usize>, pub extension_changed: bool, pub extensions_updated: Vec<String>, pub should_quit: bool,
}
Expand description

Tracks what changed during an operation.

Runner uses this to know what notifications to send to clients. All changes are accumulated internally and taken at the end of an operation via ChangeTracker::take_changes.

The multiple boolean flags are intentional - each tracks a distinct notification type that clients may need to receive.

Fields§

§mode_changed: bool

Whether the mode changed.

§cursor_moved: bool

Whether the cursor moved.

§selection_changed: bool

Whether the selection changed.

§buffer_modified: bool

Whether any buffer content was modified.

§modified_buffers: Vec<BufferId>

Buffers whose content was modified.

§modified_buffer_edits: Vec<(BufferId, Modification)>

Edit details for modified buffers (for incremental syntax parsing, #655).

Parallel to modified_buffers. Contains (BufferId, Modification) pairs for edits that have structured edit info. Empty when edits come from paths that don’t provide Modification (e.g., undo/redo).

§affected_buffers: Vec<BufferId>

All buffers affected (for cursor, selection, etc.).

§buffers_created: Vec<BufferId>

Buffers that were created.

§buffers_deleted: Vec<BufferId>

Buffers that were deleted.

§buffers_renamed: Vec<(BufferId, String)>

Buffers that were renamed: (id, new_name).

§window_changed: bool

Whether window layout changed.

§windows_created: Vec<WindowId>

Windows that were created.

§windows_closed: Vec<WindowId>

Windows that were closed.

§focus_changed: bool

Whether window focus changed.

§option_changed: bool

Whether any option changed.

§options_changed: Vec<OptionChange>

Options that changed. Each entry contains name, value, and optional window_id.

§scroll_changed: bool

Whether scroll position changed in any window.

§scrolled_windows: Vec<WindowId>

Windows whose scroll position changed.

§presence_changed: bool

Whether presence state changed (for cursor sync scenarios).

§presence_updates: Vec<usize>

Client IDs whose presence changed.

§extension_changed: bool

Whether any extension state changed (activation/deactivation).

§extensions_updated: Vec<String>

Extension kinds that changed (e.g., ["cmdline"]).

§should_quit: bool

Whether a quit was requested during this operation.

Set when a command pushes RuntimeSignal::Quit. Not included in has_changes() — quit is a lifecycle signal, not a state change that triggers notifications.

Implementations§

Source§

impl StateChanges

Source

pub fn new() -> Self

Create empty changes.

Source

pub const fn has_changes(&self) -> bool

Check if any changes occurred.

Source

pub fn merge(&mut self, other: Self)

Merge another StateChanges into this one.

Source

pub const fn record_mode_change(&mut self)

Record that the mode changed.

Source

pub fn record_cursor_move(&mut self, buffer: BufferId)

Record that the cursor moved in a buffer.

Source

pub fn record_buffer_modified(&mut self, buffer: BufferId)

Record that buffer content was modified.

Source

pub fn record_buffer_modified_with_edit( &mut self, buffer: BufferId, modification: Modification, )

Record buffer modification with structured edit info (#655).

Like record_buffer_modified but also stores the Modification data for incremental syntax parsing. The server layer uses this to call driver.update() instead of driver.parse().

Source

pub fn record_buffer_created(&mut self, buffer: BufferId)

Record that a buffer was created.

Source

pub fn record_buffer_deleted(&mut self, buffer: BufferId)

Record that a buffer was deleted.

Source

pub fn record_buffer_renamed(&mut self, buffer: BufferId, new_name: String)

Record that a buffer was renamed.

Source

pub fn record_window_created(&mut self, window: WindowId)

Record that a window was created.

Source

pub fn record_window_closed(&mut self, window: WindowId)

Record that a window was closed.

Source

pub const fn record_focus_change(&mut self)

Record that window focus changed.

Source

pub fn record_selection_change(&mut self, buffer: BufferId)

Record that selection changed in a buffer.

Source

pub fn record_option_change(&mut self, change: OptionChange)

Record that an option changed.

Source

pub fn record_global_option_change( &mut self, name: impl Into<String>, value: OptionValue, )

Record a global option change.

Source

pub fn record_window_option_change( &mut self, name: impl Into<String>, value: OptionValue, window_id: WindowId, )

Record a window-scoped option change.

Source

pub fn record_scroll_change(&mut self, window: WindowId)

Record that scroll position changed in a window.

Source

pub fn record_presence_change(&mut self, client_id: usize)

Record that presence state changed for a client (Phase 14).

Used for future cursor sync scenarios where cursor movement might trigger presence updates.

Source

pub fn record_extension_change(&mut self, kind: String)

Record that an extension’s state changed (#514).

Called when a bridge’s is_active() changes (activation/deactivation).

Source

pub const fn record_quit_requested(&mut self)

Record that a quit was requested (#547).

Called when a command pushes RuntimeSignal::Quit. The runner uses this to signal the client to disconnect.

Trait Implementations§

Source§

impl Clone for StateChanges

Source§

fn clone(&self) -> StateChanges

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StateChanges

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StateChanges

Source§

fn default() -> StateChanges

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more