diff options
| author | tv <tv@krebsco.de> | 2026-03-06 20:45:39 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-03-06 23:36:06 +0100 |
| commit | b098daf7bcb6e4a493723026f5644bd81164c641 (patch) | |
| tree | 71108cdebf54729830c72b61d725c6f91a3cfdcd /src/TextViewport/Buffer/Item.hs | |
| parent | 7e516fc31601fd07923d7033ba64f530175cac0e (diff) | |
modularize
Diffstat (limited to 'src/TextViewport/Buffer/Item.hs')
| -rw-r--r-- | src/TextViewport/Buffer/Item.hs | 27 |
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 |
