alma 0.1.0

A Bevy-native modal text editor with Vim-style navigation.
Documentation
//! Buffer edit messages.

use crate::buffer::BufferEdit;
use crate::ecs::components::buffer::BufferEntity;
use bevy::prelude::Message;

/// Request to mutate the authoritative buffer.
#[derive(Clone, Debug, Eq, Message, PartialEq)]
pub struct BufferEditRequested {
    /// Buffer entity to mutate.
    pub target: BufferEntity,
    /// The edit to apply.
    pub edit: BufferEdit,
}

/// Notification that the authoritative buffer revision changed.
#[derive(Clone, Copy, Debug, Eq, Message, PartialEq)]
pub struct BufferEdited {
    /// Buffer entity that changed.
    pub target: BufferEntity,
    /// Revision before the edit.
    pub previous_revision: crate::ecs::components::buffer::BufferRevision,
    /// Revision after the edit.
    pub current_revision: crate::ecs::components::buffer::BufferRevision,
}