gdritter repos brick-table / 2a3ec2b
Added index to FocusElement constructor Getty Ritter 7 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Collapse all Expand all
124124 -- | Represents the current focus: either a single element or a
125125 -- contiguous rectancle of focused cells from the table.
126126 data Focus e
127 = FocusElement e
127 = FocusElement (Int, Int) e
128128 | FocusRange (A.Array (Int, Int) e)
129129 deriving (Eq, Show)
130130
133133 getFocused Table
134134 { tableContents = cs
135135 , tableCurIndex = range@(lIdx, rIdx)
136 } | lIdx == rIdx = FocusElement (cs A.! lIdx)
136 } | lIdx == rIdx = FocusElement lIdx (cs A.! lIdx)
137137 | otherwise =
138138 FocusRange (A.array range [ (idx, cs A.! idx)
139139 | idx <- Ix.range range