    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveGeneric      #-}
    {-# OPTIONS_HADDOCK show-extensions #-}

    -- |
    -- Module      :  Yi.UI.LineNumbers
    -- License     :  GPL-2
    -- Maintainer  :  yi-devel@googlegroups.com
    -- Stability   :  experimental
    -- Portability :  portable
    --
    -- Line numbers.

    module Yi.UI.LineNumbers
      ( getDisplayLineNumbersLocal
      , setDisplayLineNumbersLocal
      ) where

    import           Data.Binary    (Binary (..))
    import           Data.Default   (Default (..))
    import           Data.Typeable  (Typeable)
    import           GHC.Generics   (Generic)
    import           Yi.Buffer      (getBufferDyn, putBufferDyn)
    import           Yi.Types       (BufferM, YiVariable)

    newtype DisplayLineNumbersLocal = DisplayLineNumbersLocal { DisplayLineNumbersLocal -> Maybe Bool
    unDisplayLineNumbersLocal :: Maybe Bool }
      deriving ((forall x.
     DisplayLineNumbersLocal -> Rep DisplayLineNumbersLocal x)
    -> (forall x.
        Rep DisplayLineNumbersLocal x -> DisplayLineNumbersLocal)
    -> Generic DisplayLineNumbersLocal
    forall x. Rep DisplayLineNumbersLocal x -> DisplayLineNumbersLocal
    forall x. DisplayLineNumbersLocal -> Rep DisplayLineNumbersLocal x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. DisplayLineNumbersLocal -> Rep DisplayLineNumbersLocal x
    from :: forall x. DisplayLineNumbersLocal -> Rep DisplayLineNumbersLocal x
    $cto :: forall x. Rep DisplayLineNumbersLocal x -> DisplayLineNumbersLocal
    to :: forall x. Rep DisplayLineNumbersLocal x -> DisplayLineNumbersLocal
    Generic, Typeable)

    instance Default DisplayLineNumbersLocal where
      def :: DisplayLineNumbersLocal
    def = Maybe Bool -> DisplayLineNumbersLocal
    DisplayLineNumbersLocal Maybe Bool
    forall a. Maybe a
    Nothing

    instance Binary DisplayLineNumbersLocal

    instance YiVariable DisplayLineNumbersLocal

    -- | Get the buffer-local line number setting.
    getDisplayLineNumbersLocal :: BufferM (Maybe Bool)
    getDisplayLineNumbersLocal :: BufferM (Maybe Bool)
    getDisplayLineNumbersLocal = DisplayLineNumbersLocal -> Maybe Bool
    unDisplayLineNumbersLocal (DisplayLineNumbersLocal -> Maybe Bool)
    -> BufferM DisplayLineNumbersLocal -> BufferM (Maybe Bool)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> BufferM DisplayLineNumbersLocal
    forall (m :: * -> *) a.
    (Default a, YiVariable a, MonadState FBuffer m, Functor m) =>
    m a
    getBufferDyn

    -- | Set the buffer-local line number setting.
    -- Nothing: use global setting
    -- Just True: display line numbers only in this buffer
    -- Just False: hide line numbers only in this buffer
    setDisplayLineNumbersLocal :: Maybe Bool -> BufferM ()
    setDisplayLineNumbersLocal :: Maybe Bool -> BufferM ()
    setDisplayLineNumbersLocal = DisplayLineNumbersLocal -> BufferM ()
    forall a (m :: * -> *).
    (YiVariable a, MonadState FBuffer m, Functor m) =>
    a -> m ()
    putBufferDyn (DisplayLineNumbersLocal -> BufferM ())
    -> (Maybe Bool -> DisplayLineNumbersLocal)
    -> Maybe Bool
    -> BufferM ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Maybe Bool -> DisplayLineNumbersLocal
    DisplayLineNumbersLocal