Focus: add focusRingToList function

This commit is contained in:
mu 2020-02-01 11:04:28 +08:00
parent ed86fcb8f8
commit f97943c8ea

View File

@ -10,6 +10,7 @@ module Brick.Focus
, focusGetCurrent
, focusSetCurrent
, focusRingLength
, focusRingToList
, focusRingCursor
, withFocusRing
, focusRingModify
@ -81,6 +82,11 @@ focusSetCurrent n r@(FocusRing l) =
focusRingLength :: FocusRing n -> Int
focusRingLength (FocusRing l) = C.size l
-- | Starting with the currently-focused, go right and accumulate all
-- resource names of the FocusRing in a list.
focusRingToList :: FocusRing n -> [n]
focusRingToList (FocusRing l) = C.rightElements l
-- | Modify the internal circular list structure of a focus ring
-- directly. This function permits modification of the circular list
-- using the rich Data.CircularList API.