alma 0.1.1

A Bevy-native modal text editor with Vim-style navigation.
Documentation
//! Editor focus ownership messages.

use crate::ecs::components::buffer::ViewEntity;
use bevy::prelude::Message;

pub use super::error::FocusRejectionReason;

/// Request to make one editor view the focused input and chrome target.
#[derive(Clone, Copy, Debug, Eq, Message, PartialEq)]
pub struct FocusRequested {
    /// Editor view entity that should receive focus.
    pub target: ViewEntity,
}

/// Notification that a focus request was rejected by the focus owner.
#[derive(Clone, Copy, Debug, Eq, Message, PartialEq)]
pub struct FocusRejected {
    /// Editor view entity that was requested.
    pub target: ViewEntity,
    /// Boundary reason that prevented focus.
    pub reason: FocusRejectionReason,
}