diff --git a/.github/PULL_REQUEST_TEMPLATE/enhancement.md b/.github/PULL_REQUEST_TEMPLATE/enhancement.md new file mode 100644 index 0000000000000..d98c1024721bc --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/enhancement.md @@ -0,0 +1,20 @@ +# Objective + +- Describe the objective or issue this PR addresses. +- If you're fixing a specific issue, say "Fixes #X". + +## Solution + +- Describe the solution used to achieve the objective above. + +--- + +## Changelog + +> This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. + +- What changed as a result of this PR? +- If applicable, organize changes under "Added", "Changed", or "Fixed" sub-headings +- Stick to one or two sentences. If more detail is needed for a particular change, consider adding it to the "Solution" section + - If you can't summarize the work, your change may be unreasonably large / unrelated. Consider splitting your PR to make it easier to review and merge! + diff --git a/.github/PULL_REQUEST_TEMPLATE/trivial.md b/.github/PULL_REQUEST_TEMPLATE/trivial.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/Cargo.lock b/Cargo.lock index e8345a5ad873c..7a530a20109cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1267,6 +1267,7 @@ dependencies = [ "chardetng", "clipboard-win", "crossterm", + "either", "futures-util", "helix-core", "helix-dap", diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index c362d93266571..2b9728b91154b 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -25,6 +25,7 @@ helix-vcs = { version = "0.6", path = "../helix-vcs" } winapi = "0.3" sha1_smol = "1.0" +either = "1.8" # Conversion traits once_cell = "1.17" diff --git a/helix-view/src/session/mod.rs b/helix-view/src/session/mod.rs index 9f2f5519a42cf..49c686e935b79 100644 --- a/helix-view/src/session/mod.rs +++ b/helix-view/src/session/mod.rs @@ -1,4 +1,5 @@ pub mod state; +pub mod undo; use std::{ fs::{File, OpenOptions}, diff --git a/helix-view/src/session/state.rs b/helix-view/src/session/state.rs index 5adf74bea9d61..e4c359e64ab6f 100644 --- a/helix-view/src/session/state.rs +++ b/helix-view/src/session/state.rs @@ -3,10 +3,6 @@ use std::path::PathBuf; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct BufferList(pub Vec); - -#[derive(Debug)] pub struct State { - buffers + buffers: Vec, } - diff --git a/helix-view/src/session/undo.rs b/helix-view/src/session/undo.rs new file mode 100644 index 0000000000000..f719cf5a30194 --- /dev/null +++ b/helix-view/src/session/undo.rs @@ -0,0 +1,28 @@ +use std::io::Result; +use std::path::PathBuf; + +use either::Either; +use helix_core::history::History; + +pub struct UndoFile<'a> { + path: PathBuf, + history: Either, +} + +impl<'a> UndoFile<'a> { + fn serialize(&self) -> Result<()> { + todo!() + } + + fn deserialize() -> Result { + todo!() + } + + fn serialize_transaction(&self) -> Result<()> { + todo!() + } + + fn deserialize_transaction(&self) -> Result<()> { + todo!() + } +}