{-# LANGUAGE DeriveGeneric #-}
module Vgrep.Command where

import GHC.Generics

data Command
    = DisplayPagerOnly     -- ^ Display the pager full-screen
    | DisplayResultsOnly   -- ^ Display the results list full-screen
    | SplitFocusPager      -- ^ Split screen, focus on pager
    | SplitFocusResults    -- ^ Split screen, focus on results list

    | PagerUp              -- ^ Scroll one line up in pager
    | PagerDown            -- ^ Scroll one line down in pager
    | PagerPageUp          -- ^ Scroll one page up in pager
    | PagerPageDown        -- ^ Scroll one page down in pager
    | PagerHalfPageUp      -- ^ Scroll half a page up in pager
    | PagerHalfPageDown    -- ^ Scroll half a page down in pager
    | PagerScrollLeft      -- ^ Scroll eight characters left in pager
    | PagerScrollRight     -- ^ Scroll eight characters right in pager

    | ResultsUp            -- ^ Move to previous result
    | ResultsDown          -- ^ Move to next result
    | ResultsPageUp        -- ^ Move one page up in results list
    | ResultsPageDown      -- ^ Move one page down in results list

    | PrevResult           -- ^ Move to previous result and update pager
    | NextResult           -- ^ Move to next result and update pager
    | PagerGotoResult      -- ^ Update pager with currently selected result

    | OpenFileInEditor     -- ^ Open file in external editor and jump to
                           -- currently selected result

    | Exit                 -- ^ Exit the application

    | Unset                -- ^ Treat keybinding as if not present, fall back to
                           -- alternative binding (used to override keybindings)

    deriving (Command -> Command -> Bool
(Command -> Command -> Bool)
-> (Command -> Command -> Bool) -> Eq Command
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Command -> Command -> Bool
$c/= :: Command -> Command -> Bool
== :: Command -> Command -> Bool
$c== :: Command -> Command -> Bool
Eq, Int -> Command -> ShowS
[Command] -> ShowS
Command -> String
(Int -> Command -> ShowS)
-> (Command -> String) -> ([Command] -> ShowS) -> Show Command
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Command] -> ShowS
$cshowList :: [Command] -> ShowS
show :: Command -> String
$cshow :: Command -> String
showsPrec :: Int -> Command -> ShowS
$cshowsPrec :: Int -> Command -> ShowS
Show, (forall x. Command -> Rep Command x)
-> (forall x. Rep Command x -> Command) -> Generic Command
forall x. Rep Command x -> Command
forall x. Command -> Rep Command x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Command x -> Command
$cfrom :: forall x. Command -> Rep Command x
Generic)