From 80277d6813ec2968432f2224b45eb4b6426d22f5 Mon Sep 17 00:00:00 2001 From: ynqa Date: Wed, 14 Feb 2024 22:38:11 +0900 Subject: [PATCH] move history, suggest and mode into text_editor/ dir --- src/core/text_editor.rs | 8 +++++++- src/core/text_editor/{render => }/history.rs | 0 src/core/text_editor/mode.rs | 9 +++++++++ src/core/text_editor/render.rs | 17 +---------------- src/core/text_editor/{render => }/suggest.rs | 0 5 files changed, 17 insertions(+), 17 deletions(-) rename src/core/text_editor/{render => }/history.rs (100%) create mode 100644 src/core/text_editor/mode.rs rename src/core/text_editor/{render => }/suggest.rs (100%) diff --git a/src/core/text_editor.rs b/src/core/text_editor.rs index 4b8acc7d..0b8514c1 100644 --- a/src/core/text_editor.rs +++ b/src/core/text_editor.rs @@ -1,5 +1,11 @@ +mod history; +pub use history::History; mod render; -pub use render::{History, Mode, Renderer, Suggest}; +pub use render::Renderer; +mod suggest; +pub use suggest::Suggest; +mod mode; +pub use mode::Mode; mod build; pub use build::Builder; diff --git a/src/core/text_editor/render/history.rs b/src/core/text_editor/history.rs similarity index 100% rename from src/core/text_editor/render/history.rs rename to src/core/text_editor/history.rs diff --git a/src/core/text_editor/mode.rs b/src/core/text_editor/mode.rs new file mode 100644 index 00000000..0bb5731f --- /dev/null +++ b/src/core/text_editor/mode.rs @@ -0,0 +1,9 @@ +/// Edit mode. +#[derive(Clone, Default)] +pub enum Mode { + #[default] + /// Insert a char at the current position. + Insert, + /// Overwrite a char at the current position. + Overwrite, +} diff --git a/src/core/text_editor/render.rs b/src/core/text_editor/render.rs index 2298c68b..c61a297c 100644 --- a/src/core/text_editor/render.rs +++ b/src/core/text_editor/render.rs @@ -8,24 +8,9 @@ use crate::{ grapheme::{matrixify, Graphemes}, pane::Pane, render::{AsAny, Renderable, State}, - text_editor::TextEditor, + text_editor::{History, Mode, Suggest, TextEditor}, }; -mod history; -pub use history::History; -mod suggest; -pub use suggest::Suggest; - -/// Edit mode. -#[derive(Clone, Default)] -pub enum Mode { - #[default] - /// Insert a char at the current position. - Insert, - /// Overwrite a char at the current position. - Overwrite, -} - #[derive(Clone)] pub struct Renderer { pub texteditor: TextEditor, diff --git a/src/core/text_editor/render/suggest.rs b/src/core/text_editor/suggest.rs similarity index 100% rename from src/core/text_editor/render/suggest.rs rename to src/core/text_editor/suggest.rs