summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-11-10 18:16:22 +0400
committerGitHub <noreply@github.com>2023-11-10 18:16:22 +0400
commit5060f8eeb864e8c304fbad9588bdd882db942356 (patch)
treeb615ded19e6ac545b495f716e2a22ecd903332af /alacritty_terminal/src/grid
parent3ffd6c8f26f9788466b9ba95659b8de970a10f08 (diff)
downloadalacritty-5060f8eeb864e8c304fbad9588bdd882db942356.tar.gz
alacritty-5060f8eeb864e8c304fbad9588bdd882db942356.zip
Remove `alacritty_config` from alacritty_terminal
There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself.
Diffstat (limited to 'alacritty_terminal/src/grid')
-rw-r--r--alacritty_terminal/src/grid/mod.rs10
-rw-r--r--alacritty_terminal/src/grid/row.rs4
-rw-r--r--alacritty_terminal/src/grid/storage.rs4
3 files changed, 12 insertions, 6 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs
index 232201ec..8fdde0a4 100644
--- a/alacritty_terminal/src/grid/mod.rs
+++ b/alacritty_terminal/src/grid/mod.rs
@@ -3,11 +3,12 @@
use std::cmp::{max, min};
use std::ops::{Bound, Deref, Index, IndexMut, Range, RangeBounds};
+#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
-use crate::ansi::{CharsetIndex, StandardCharset};
use crate::index::{Column, Line, Point};
use crate::term::cell::{Flags, ResetDiscriminant};
+use crate::vte::ansi::{CharsetIndex, StandardCharset};
pub mod resize;
mod row;
@@ -104,14 +105,15 @@ pub enum Scroll {
/// ^
/// columns
/// ```
-#[derive(Serialize, Deserialize, Clone, Debug)]
+#[derive(Clone, Debug)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Grid<T> {
/// Current cursor for writing data.
- #[serde(skip)]
+ #[cfg_attr(feature = "serde", serde(skip))]
pub cursor: Cursor<T>,
/// Last saved cursor.
- #[serde(skip)]
+ #[cfg_attr(feature = "serde", serde(skip))]
pub saved_cursor: Cursor<T>,
/// Lines in the grid. Each row holds a list of cells corresponding to the
diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs
index 2a92a78c..951ef093 100644
--- a/alacritty_terminal/src/grid/row.rs
+++ b/alacritty_terminal/src/grid/row.rs
@@ -4,6 +4,7 @@ use std::cmp::{max, min};
use std::ops::{Index, IndexMut, Range, RangeFrom, RangeFull, RangeTo, RangeToInclusive};
use std::{ptr, slice};
+#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use crate::grid::GridCell;
@@ -11,7 +12,8 @@ use crate::index::Column;
use crate::term::cell::ResetDiscriminant;
/// A row in the grid.
-#[derive(Serialize, Deserialize, Default, Clone, Debug)]
+#[derive(Default, Clone, Debug)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Row<T> {
inner: Vec<T>,
diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs
index 8e270d2d..d5709d14 100644
--- a/alacritty_terminal/src/grid/storage.rs
+++ b/alacritty_terminal/src/grid/storage.rs
@@ -3,6 +3,7 @@ use std::mem;
use std::mem::MaybeUninit;
use std::ops::{Index, IndexMut};
+#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use super::Row;
@@ -27,7 +28,8 @@ const MAX_CACHE_SIZE: usize = 1_000;
/// [`slice::rotate_left`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rotate_left
/// [`Deref`]: std::ops::Deref
/// [`zero`]: #structfield.zero
-#[derive(Serialize, Deserialize, Clone, Debug)]
+#[derive(Clone, Debug)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Storage<T> {
inner: Vec<Row<T>>,