Enum nvimpam_lib::event::Event [−][src]
pub enum Event { LinesEvent { buf: Buffer, changedtick: u64, firstline: i64, lastline: i64, linedata: Vec<String>, more: bool, }, ChangedTickEvent { buf: Buffer, changedtick: u64, }, DetachEvent { buf: Buffer, }, RefreshFolds, Quit, }
The event list the main loop reacts to
Variants
LinesEvent
The update notification for a buffer change. Full lines only. Firstline
is zero-indexed (i.e. a change on the first line will have firstline = 0
). The range from firstline to lastline is end-exclusive. more
indicates if we need to expect another event of this type with more
lines, in case Neovim decided to split up the buffer (not yet
implemented).
Fields of LinesEvent
buf: Buffer | |
changedtick: u64 | |
firstline: i64 | |
lastline: i64 | |
linedata: Vec<String> | |
more: bool |
ChangedTickEvent
Update notification for a new changedtick
without a buffer change.
Used by undo/redo.
Fields of ChangedTickEvent
buf: Buffer | |
changedtick: u64 |
DetachEvent
Notification the liveupdates are ending. Possible causes:
- Closing all a buffer's windows (unless 'hidden' is enabled).
- Using |:edit| to reload the buffer
- reloading the buffer after it is changed from outside neovim.
Fields of DetachEvent
buf: Buffer |
RefreshFolds
Recreate and resend the folds
Quit
This plugin should quit. Currently only sent by the user directly.
Methods
impl Event
[src]
impl Event
pub fn event_loop(receiver: &Receiver<Event>, nvim: Neovim) -> Result<(), Error>
[src]
pub fn event_loop(receiver: &Receiver<Event>, nvim: Neovim) -> Result<(), Error>
Run the event loop. The receiver receives the events from the handler.
The loop starts by enabling
buffer events.
It creates lines
and a
foldlist
and updates them from the
events received. It calls
resend_all
when
the foldlist
was created, or the
RefreshFolds
event
was sent.
Sending the Quit
event will
exit the loop and return from the function.