Skip to main content

EditorView

Struct EditorView 

Source
pub struct EditorView {
Show 23 fields pub buffer: Buffer, pub folds: FoldState, pub highlighter: SyntaxHighlighter, pub gutter_markers: Vec<GutterMarker>, pub status_msg: Option<String>, pub completion: Option<CompletionState>, pub hover: Option<HoverState>, pub lsp_version: i32, pub deferred_ops: Vec<Operation>, pub search: Option<SearchState>, pub last_search: Option<SearchState>, pub go_to_line: Option<GoToLineState>, pub word_wrap: bool, pub show_line_numbers: bool, pub use_space: bool, pub indentation_width: usize, pub highlight_cache: HashMap<usize, Vec<StyledSpan>>, pub pending_highlight_lines: HashSet<usize>, pub stale_highlight_lines: HashSet<usize>, pub highlight_task: Option<JoinHandle<()>>, pub highlight_generation: u64, pub external_conflict_msg: Option<String>, pub lang_id: Option<LanguageId>, /* private fields */
}

Fields§

§buffer: Buffer§folds: FoldState§highlighter: SyntaxHighlighter§gutter_markers: Vec<GutterMarker>§status_msg: Option<String>§completion: Option<CompletionState>§hover: Option<HoverState>§lsp_version: i32

Incremented on every buffer change; sent with textDocument/didChange.

§deferred_ops: Vec<Operation>

Secondary ops produced by completion-confirm that the view needs to emit but cannot return from handle_operation. Drained by app.rs.

§search: Option<SearchState>

Active search/replace state; None when bar is closed.

§last_search: Option<SearchState>

Last committed search; kept alive after the bar closes so F3 still works.

§go_to_line: Option<GoToLineState>

Active go-to-line bar state; None when closed.

§word_wrap: bool

When true, long lines are soft-wrapped instead of clipped horizontally.

§show_line_numbers: bool

When true, line numbers are shown in the gutter.

§use_space: bool

When true, use spaces for indentation; otherwise use tabs.

§indentation_width: usize

Number of spaces (or tab width) for indentation.

§highlight_cache: HashMap<usize, Vec<StyledSpan>>

Fully computed highlight cache keyed by line number. Lines are never erased on edits — only updated when recomputed.

§pending_highlight_lines: HashSet<usize>

Lines currently being computed in background (avoid redundant tasks).

§stale_highlight_lines: HashSet<usize>

Lines whose cached spans are stale (content changed) but are kept in highlight_cache for flicker-free rendering until fresh results arrive.

§highlight_task: Option<JoinHandle<()>>

Handle for the in-flight background highlight task.

§highlight_generation: u64

Generation counter for highlight tasks. Incremented on each edit to detect and discard stale completions.

§external_conflict_msg: Option<String>

Message shown when external modification is detected.

§lang_id: Option<LanguageId>

Detected language of the open file (e.g. "rust", "python").

Implementations§

Source§

impl EditorView

Source

pub fn open(buffer: Buffer, folds: FoldState, settings: &Settings) -> Self

Source

pub fn into_state(self) -> (Buffer, FoldState)

Source

pub fn take_deferred_ops(&mut self) -> Vec<Operation>

Drain any secondary ops produced during the last handle_operation call.

Source

pub fn start_file_watching(&mut self)

Source

pub fn stop_file_watching(&mut self)

Source

pub fn check_external_modification_for_paths( &mut self, changed_paths: &[PathBuf], ) -> bool

Source

pub fn reload_from_disk(&mut self) -> Result<()>

Source

pub fn clear_external_modification(&mut self)

Source§

impl EditorView

Source

pub fn render_with_registers( &mut self, frame: &mut Frame<'_>, area: Rect, registers: &Registers, _theme: &Theme, )

Full render path used by app::render — passes the yank ring so the clipboard history picker reads from the authoritative source.

Trait Implementations§

Source§

impl Debug for EditorView

Source§

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

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

impl View for EditorView

Source§

fn handle_key(&self, key: KeyEvent) -> Vec<Operation>

Translate key input into operations — no mutation of self.

Source§

fn handle_operation( &mut self, op: &Operation, _settings: &Settings, ) -> Option<Event>

Apply operations this view owns. Ignores ops that belong elsewhere.

Source§

const KIND: ViewKind = crate::views::ViewKind::Primary

The kind of this view: ViewKind::Primary or ViewKind::Modal. Read more
Source§

fn save_state(&mut self, app: &mut AppState)

Save the current state of the view before it is closed.
Source§

fn handle_mouse(&self, mouse: MouseEvent) -> Vec<Operation>

Translate a mouse event into zero or more operations. Default implementation is a no-op; views that support mouse override this.
Source§

fn render(&self, frame: &mut Frame<'_>, area: Rect, _theme: &Theme)

Draw the view into the provided area of the current frame.
Source§

fn status_bar(&self, _state: &AppState, bar: &mut StatusBarBuilder)

Populate the global status bar with view-specific content. 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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.