model: replace LineBits::DIRTY with a sequence number

Terminal now maintains a sequence number that increments
for each Action that is applied to it.

Changes to lines are tagged with the current sequence number.

This makes it a bit easier to reason about when an individual
line has changed relative to some point in "time"; the consumer
of the terminal can sample the current sequence number and then
can later determine which lines have changed since that point
in time.

refs: https://github.com/wez/wezterm/issues/867
This commit is contained in:
Wez Furlong committed 2021-08-08 12:45:08 -07:00
1 parent 2e158f58f3
commit eae327efcc
28 files changed
+477 -289

No files matched your search

+3 -2
View File
@@ -28,7 +28,7 @@ use std::io::Cursor;
use std::ops::Range;
use std::sync::Arc;
use termwiz::hyperlink::Hyperlink;
use termwiz::surface::Line;
use termwiz::surface::{Line, SequenceNo};
use varbincode;
use wezterm_term::color::ColorPalette;
use wezterm_term::{Alert, ClipboardSelection, StableRowIndex};
@@ -401,7 +401,7 @@ macro_rules! pdu {
/// The overall version of the codec.
/// This must be bumped when backwards incompatible changes
/// are made to the types and protocol.
pub const CODEC_VERSION: usize = 8;
pub const CODEC_VERSION: usize = 9;
// Defines the Pdu enum.
// Each struct has an explicit identifying number.
@@ -729,6 +729,7 @@ pub struct GetPaneRenderChangesResponse {
pub bonus_lines: SerializedLines,
pub input_serial: Option<InputSerial>,
pub seqno: SequenceNo,
}
#[derive(Deserialize, Serialize, PartialEq, Debug)]