aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/wire.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/wire.rs')
-rw-r--r--src/protocol/wire.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/protocol/wire.rs b/src/protocol/wire.rs
index 052c73a3..a29c6ca6 100644
--- a/src/protocol/wire.rs
+++ b/src/protocol/wire.rs
@@ -699,7 +699,7 @@ pub enum AttachScrollSource {
/// A single cell in a rendered frame, serialized independently from ratatui's
/// `Cell` type to keep the wire protocol stable.
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CellData {
/// Grapheme cluster displayed in this cell (usually 1–2 chars).
pub symbol: String,
@@ -715,6 +715,21 @@ pub struct CellData {
pub hyperlink: Option<u32>,
}
+impl Clone for CellData {
+ fn clone(&self) -> Self {
+ Self {
+ symbol: self.symbol.clone(),
+ ..*self
+ }
+ }
+
+ fn clone_from(&mut self, source: &Self) {
+ let mut symbol = std::mem::take(&mut self.symbol);
+ symbol.clone_from(&source.symbol);
+ *self = Self { symbol, ..*source };
+ }
+}
+
impl CellData {
pub(crate) fn from_ratatui_cell(cell: &ratatui::buffer::Cell) -> Self {
Self {