Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Results
- currentFileName :: Getter Results (Maybe Text)
- currentLineNumber :: Getter Results (Maybe Int)
- currentFileResults :: Getter Results (IntMap AnsiFormatted)
- feed :: FileLineReference -> Results -> Results
- showPrev :: Results -> Maybe Results
- showNext :: Results -> Maybe Results
- hidePrev :: Results -> Maybe Results
- hideNext :: Results -> Maybe Results
- moveUp :: Results -> Maybe Results
- moveDown :: Results -> Maybe Results
- resize :: Int -> Results -> Maybe Results
- data DisplayLine
- toLines :: Results -> [DisplayLine]
- displayLineNumber :: DisplayLine -> Maybe Int
Results widget state
Results widget state
EmptyResults | The results list is empty |
Results !(Seq FileLineReference) !(Seq FileLineReference) !FileLineReference !(Seq FileLineReference) !(Seq FileLineReference) | The structure of the Results buffer is a double Zipper:
|
Instances
Lenses
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
Actions
In general, actions return
if the buffer has
changed, and Just
newResults
otherwise. This way it is easy to recognize
whether or not a Nothing
Redraw
is necessary.
showPrev :: Results -> Maybe Results Source #
Show one more item at the top of the screen if available.
showNext :: Results -> Maybe Results Source #
Show one more item at the bottom of the screen if available.
hidePrev :: Results -> Maybe Results Source #
Remove the first item from the top of the screen and append it to the invisible items above.
hideNext :: Results -> Maybe Results Source #
Remove the last item from the bottom of the screen and prepend it to the invisible items below.
:: Int | the new height |
-> Results | |
-> Maybe Results |
|
Adjust the number of on-screen items to the given height:
- If the current list is too long for the new height, take items from the top until the current item is topmost, then from the bottom.
- If the current list is too short for the new height, add items below until the buffer is empty, then above.
Utilities for displaying
data DisplayLine Source #
Ad-hoc data structure to render the (visible) Results
as list of
lines.
Instances
Eq DisplayLine Source # | |
Defined in Vgrep.Widget.Results.Internal (==) :: DisplayLine -> DisplayLine -> Bool # (/=) :: DisplayLine -> DisplayLine -> Bool # |
toLines :: Results -> [DisplayLine] Source #
Converts the visible Results
to a list of DisplayLine
s. Each item
in the returned list corresponds to a line on the screen.
Each group of Line
s that points to the same file is prepended with
a FileHeader
. The item below the cursor becomes a SelectedLine
.
displayLineNumber :: DisplayLine -> Maybe Int Source #
The line number of a DisplayLine
. Nothing
for FileHeader
s.