summaryrefslogtreecommitdiffstats
path: root/src/TextViewport/Buffer/Item.hs
blob: b5ea743ef32771604b82d0770d7417c64ad887f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module TextViewport.Buffer.Item where

import Data.Text (Text)
import Data.HashMap.Strict qualified as HM
import Text.Hyphenation qualified as H


data Item a = Item
  { itemText :: a
  , itemSegments :: SegmentStrategy a
  }
  deriving (Eq, Show)

data SegmentStrategy a
  = NoSegments
  | FixedWidthSegments
  | HyphenateSegments
      { hsLang  :: H.Language
      , hsCache :: HM.HashMap a [(a, a)]
      }
  deriving (Eq, Show)