Skip to content

cursive assertions for UTF-8 symbols #221

@azat

Description

@azat

Repro - 01666_blns_long.sql test, and look at the logs for original CREATE TABLE original query (not CREATE TABLE AS)

in printer.rs

https://github.com/gyscos/cursive/blob/01632ac5996666461670bf84291e3b06cfeaf5ad/cursive-core/src/printer.rs#L230 (left = 289, right = 291)

in CellWidth

azat:~/.../2c18a81/cursive-core (main)[N] {elapsed: 5s}$ git di
diff --git a/cursive-core/src/buffer.rs b/cursive-core/src/buffer.rs
index 64f66d0..7520c46 100644
--- a/cursive-core/src/buffer.rs
+++ b/cursive-core/src/buffer.rs
@@ -17,6 +17,10 @@ pub enum CellWidth {

     /// This character takes 2 cells in the grid (mostly for emojis and asian characters).
     Double,
+
+    W3,
+    W4,
+    W5,
 }

 impl Default for CellWidth {
@@ -35,6 +39,9 @@ impl CellWidth {
         match width {
             1 => CellWidth::Single,
             2 => CellWidth::Double,
+            3 => CellWidth::W3,
+            4 => CellWidth::W4,
+            5 => CellWidth::W5,
             n => panic!("expected width of 1 or 2 only. Got {n}."),
         }
     }
@@ -44,6 +51,9 @@ impl CellWidth {
         match self {
             CellWidth::Single => 1,
             CellWidth::Double => 2,
+            CellWidth::W3 => 3,
+            CellWidth::W4 => 4,
+            CellWidth::W5 => 5,
         }
     }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions