Skip to main content

wedi_widget/
lib.rs

1//! wedi-widget - 可嵌入的編輯器 Widget
2//!
3//! 提供可在其他 TUI 應用程式中嵌入的編輯器元件。
4//!
5//! # 主要類型
6//!
7//! - [`EditorConfig`] - 編輯器配置選項
8//! - [`ScreenLayout`] - 螢幕佈局管理
9//! - [`LineLayout`] - 行佈局處理
10//!
11//! # 使用範例
12//!
13//! ```rust
14//! use wedi_widget::{EditorConfig, ScreenLayout};
15//!
16//! let config = EditorConfig::new()
17//!     .with_line_numbers(true)
18//!     .with_tab_width(4);
19//!
20//! let layout = ScreenLayout::new(24, 80);
21//! ```
22
23pub mod config;
24pub mod layout;
25
26// 重新匯出 wedi-core 的主要類型供便利使用
27pub use wedi_core::{
28    buffer::RopeBuffer,
29    cursor::Cursor,
30    keymap::{Command, Direction, Keymap},
31    search::Search,
32    view::{Selection, View},
33    Terminal,
34};
35
36// 重新匯出本地類型
37pub use config::EditorConfig;
38pub use layout::{LineLayout, ScreenLayout};