Added index to FocusElement constructor
Getty Ritter
7 years ago
124 | 124 | -- | Represents the current focus: either a single element or a |
125 | 125 | -- contiguous rectancle of focused cells from the table. |
126 | 126 | data Focus e |
127 |
= FocusElement |
|
127 | = FocusElement (Int, Int) e | |
128 | 128 | | FocusRange (A.Array (Int, Int) e) |
129 | 129 | deriving (Eq, Show) |
130 | 130 | |
133 | 133 | getFocused Table |
134 | 134 | { tableContents = cs |
135 | 135 | , tableCurIndex = range@(lIdx, rIdx) |
136 |
} | lIdx == rIdx = FocusElement |
|
136 | } | lIdx == rIdx = FocusElement lIdx (cs A.! lIdx) | |
137 | 137 | | otherwise = |
138 | 138 | FocusRange (A.array range [ (idx, cs A.! idx) |
139 | 139 | | idx <- Ix.range range |