diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-03 16:14:10 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-03 16:14:10 -0500 |
commit | d648b8f074965110938bbca4dd502309d1fa75ca (patch) | |
tree | 069f25ccfc7f2255f20515ea9a886208226f8328 | |
parent | 3271d413770f5c0d916caaa8d0dabac0b758f0f4 (diff) | |
download | vt100-rust-d648b8f074965110938bbca4dd502309d1fa75ca.tar.gz vt100-rust-d648b8f074965110938bbca4dd502309d1fa75ca.zip |
another missing attribute setting
-rw-r--r-- | src/row.rs | 5 | ||||
-rw-r--r-- | tests/data/fixtures/il_dl.in | 2 | ||||
-rw-r--r-- | tests/data/fixtures/il_dl/23.json | 21 | ||||
-rw-r--r-- | tests/data/fixtures/il_dl/23.typescript | 1 | ||||
-rw-r--r-- | tests/data/fixtures/il_dl/24.json | 21 | ||||
-rw-r--r-- | tests/data/fixtures/il_dl/24.typescript | 1 |
6 files changed, 51 insertions, 0 deletions
@@ -457,6 +457,11 @@ impl Row { } let end_cell = self.get(end_pos.col).unwrap(); if end_cell.has_contents() { + let attrs = end_cell.attrs(); + if &prev_attrs != attrs { + attrs.write_escape_code_diff(contents, &prev_attrs); + prev_attrs = *attrs; + } contents.extend(end_cell.contents().as_bytes()); prev_pos.col += if end_cell.is_wide() { 2 } else { 1 }; } diff --git a/tests/data/fixtures/il_dl.in b/tests/data/fixtures/il_dl.in index b2519a6..3e2a3f2 100644 --- a/tests/data/fixtures/il_dl.in +++ b/tests/data/fixtures/il_dl.in @@ -20,3 +20,5 @@ cd \x1b[L \x1bc\x1b[1;80H\x1b[1mab\x1b[M \x1bc\x1b[23;80Hab\x1b[23H\x1b[L +\x1bc\x1b[1mb\x1b[1;80Ha\x1b[L\x1b[1;80Hab\x1b[H +\x1b[L diff --git a/tests/data/fixtures/il_dl/23.json b/tests/data/fixtures/il_dl/23.json new file mode 100644 index 0000000..c60437b --- /dev/null +++ b/tests/data/fixtures/il_dl/23.json @@ -0,0 +1,21 @@ +{ + "contents": " ab a", + "cells": { + "0,79": { + "contents": "a", + "bold": true + }, + "1,0": { + "contents": "b", + "bold": true + }, + "1,79": { + "contents": "a", + "bold": true + } + }, + "cursor_position": [ + 0, + 0 + ] +}
\ No newline at end of file diff --git a/tests/data/fixtures/il_dl/23.typescript b/tests/data/fixtures/il_dl/23.typescript new file mode 100644 index 0000000..352df3d --- /dev/null +++ b/tests/data/fixtures/il_dl/23.typescript @@ -0,0 +1 @@ +c[1mb[1;80Ha[L[1;80Hab[H
\ No newline at end of file diff --git a/tests/data/fixtures/il_dl/24.json b/tests/data/fixtures/il_dl/24.json new file mode 100644 index 0000000..20b4746 --- /dev/null +++ b/tests/data/fixtures/il_dl/24.json @@ -0,0 +1,21 @@ +{ + "contents": "\n ab a", + "cells": { + "1,79": { + "contents": "a", + "bold": true + }, + "2,0": { + "contents": "b", + "bold": true + }, + "2,79": { + "contents": "a", + "bold": true + } + }, + "cursor_position": [ + 0, + 0 + ] +}
\ No newline at end of file diff --git a/tests/data/fixtures/il_dl/24.typescript b/tests/data/fixtures/il_dl/24.typescript new file mode 100644 index 0000000..a330c08 --- /dev/null +++ b/tests/data/fixtures/il_dl/24.typescript @@ -0,0 +1 @@ +[L
\ No newline at end of file |