summaryrefslogtreecommitdiffstats
path: root/src/TextViewport/Buffer/Item.hs
blob: 81d18ef6440759457ba772a740da28766cf1f57c (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 = Item
  { itemText :: Text
  , itemSegments :: SegmentStrategy
  }
  deriving (Eq, Show)

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