{-# OPTIONS_HADDOCK show-extensions #-}
module Yi.Boot.Internal where
import Config.Dyre.Relaunch (relaunchWithBinaryState)
import Control.Monad.Base (liftBase)
import Control.Monad.State (get)
import Yi.Keymap (YiM, withUI)
import Yi.Types (withEditor)
import Yi.UI.Common (end)
reload :: YiM ()
reload :: YiM ()
reload = do
Editor
editor <- EditorM Editor -> YiM Editor
forall (m :: * -> *) a. MonadEditor m => EditorM a -> m a
withEditor EditorM Editor
forall s (m :: * -> *). MonadState s m => m s
get
(UI Editor -> IO ()) -> YiM ()
forall a. (UI Editor -> IO a) -> YiM a
withUI (UI Editor -> Maybe ExitCode -> IO ()
forall e. UI e -> Maybe ExitCode -> IO ()
`end` Maybe ExitCode
forall a. Maybe a
Nothing)
IO () -> YiM ()
forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α
liftBase (IO () -> YiM ()) -> IO () -> YiM ()
forall a b. (a -> b) -> a -> b
$ Maybe Editor -> Maybe [String] -> IO ()
forall a. Binary a => a -> Maybe [String] -> IO ()
relaunchWithBinaryState (Editor -> Maybe Editor
forall a. a -> Maybe a
Just Editor
editor) Maybe [String]
forall a. Maybe a
Nothing