vgrep-0.1.3.0: A pager for grep

Safe HaskellNone
LanguageHaskell2010

Vgrep.Widget.HorizontalSplit.Internal

Contents

Synopsis

Split-view widget state

data HSplit s t Source #

The internal state of the split-view widget. Tracks the state of both child widgets and the current layout.

Constructors

HSplit 

Fields

data Layout Source #

Instances

Eq Layout Source # 

Methods

(==) :: Layout -> Layout -> Bool #

(/=) :: Layout -> Layout -> Bool #

data Focus Source #

Constructors

FocusLeft 
FocusRight 

Instances

Eq Focus Source # 

Methods

(==) :: Focus -> Focus -> Bool #

(/=) :: Focus -> Focus -> Bool #

Auto-generated lenses

leftWidget :: forall s t s. Lens (HSplit s t) (HSplit s t) s s Source #

rightWidget :: forall s t t. Lens (HSplit s t) (HSplit s t) t t Source #

layout :: forall s t. Lens' (HSplit s t) Layout Source #

Additional lenses

currentWidget :: Lens' (HSplit s t) (Either s t) Source #

The currently focused child widget

>>> view currentWidget $ HSplit { _leftWidget = "foo", _layout = LeftOnly }
Left "foo"

leftWidgetFocused :: Traversal' (HSplit s t) s Source #

Traverses the left widget if focused

>>> has leftWidgetFocused $ HSplit { _layout = LeftOnly }
True
>>> has leftWidgetFocused $ HSplit { _layout = RightOnly }
False
>>> has leftWidgetFocused $ HSplit { _layout = Split FocusLeft (1 % 2) }
True

rightWidgetFocused :: Traversal' (HSplit s t) t Source #

Traverses the right widget if focused

>>> has rightWidgetFocused $ HSplit { _layout = RightOnly }
True
>>> has rightWidgetFocused $ HSplit { _layout = LeftOnly }
False
>>> has rightWidgetFocused $ HSplit { _layout = Split FocusRight (1 % 2) }
True

Re-exports

(%) :: Integral a => a -> a -> Ratio a infixl 7 #

Forms the ratio of two integral numbers.