vgrep-0.2.3.0: A pager for grep
Safe HaskellNone
LanguageHaskell2010

Vgrep.Widget.Results

Synopsis

Results list widget

resultsWidget :: ResultsWidget Source #

The results widget displays a list of lines with line numbers, grouped by files.

  • Initial state

    The initial buffer is empty and can be filled line by line using feedResult.

  • Drawing the results list

    Found matches are grouped by file name. Each file group has a header and a list of result lines with line numbers. The result lines can be selected with the cursor, the file group headers are skipped. When only part of a file group is shown at the top of the screen, the header is shown nevertheless.

Internal widget state

data Results Source #

Results widget state

Instances

Instances details
Eq Results Source # 
Instance details

Defined in Vgrep.Widget.Results.Internal

Methods

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

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

Show Results Source # 
Instance details

Defined in Vgrep.Widget.Results.Internal

Widget actions

feedResult :: Monad m => FileLineReference -> VgrepT Results m Redraw Source #

Add a line to the results list. If the result is found in the same file as the current last result, it will be added to the same results group, otherwise a new group will be opened.

prevLine :: Monad m => VgrepT Results m () Source #

Move up/down one results line. File group headers will be skipped.

nextLine :: Monad m => VgrepT Results m () Source #

Move up/down one results line. File group headers will be skipped.

pageUp :: Monad m => VgrepT Results m () Source #

Move up/down one results page. File group headers will be skipped.

pageDown :: Monad m => VgrepT Results m () Source #

Move up/down one results page. File group headers will be skipped.

Lenses

currentFileName :: Getter Results (Maybe Text) Source #

The file name of the currently selected item

currentLineNumber :: Getter Results (Maybe Int) Source #

The line number of the currently selected item

currentFileResults :: Getter Results (IntMap AnsiFormatted) Source #

The line numbers with matches in the file of the currentliy selected item

Re-exports