summaryrefslogtreecommitdiffstats
path: root/src/TextViewport/Buffer/Item.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextViewport/Buffer/Item.hs')
-rw-r--r--src/TextViewport/Buffer/Item.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/TextViewport/Buffer/Item.hs b/src/TextViewport/Buffer/Item.hs
new file mode 100644
index 0000000..b08aaf4
--- /dev/null
+++ b/src/TextViewport/Buffer/Item.hs
@@ -0,0 +1,27 @@
+module TextViewport.Buffer.Item where
+
+import Data.Text (Text)
+import Data.HashMap.Strict qualified as HM
+import Text.Hyphenation qualified as H
+
+
+data Item = Item
+ { itemText :: Text
+ , itemSegments :: SegmentStrategy
+ }
+ deriving (Eq, Show)
+
+data SegmentStrategy
+ = NoSegments
+ | FixedWidthSegments
+ | HyphenateSegments
+ { hsDict :: H.Hyphenator
+ , hsCache :: HM.HashMap Text [(Text, Text)]
+ }
+ deriving (Eq, Show)
+
+instance Show H.Hyphenator where
+ show _ = "<Hyphenator>"
+
+instance Eq H.Hyphenator where
+ a == b = False