Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The Settings
API, an effect for accessing Neovim variables with defaults.
Synopsis
- data Setting a = Setting {}
- data SettingError
- menuMarginVertical :: Setting Float
- menuMarginHorizontal :: Setting Float
- data Settings :: Effect
- get :: forall a r. MsgpackDecode a => Member Settings r => Setting a -> Sem r a
- update :: forall a r. MsgpackEncode a => Member Settings r => Setting a -> a -> Sem r ()
- or :: MsgpackDecode a => Member (Settings !! SettingError) r => a -> Setting a -> Sem r a
- maybe :: MsgpackDecode a => Member (Settings !! SettingError) r => Setting a -> Sem r (Maybe a)
Documentation
This type is used by the effect Settings
, representing a Neovim variable associated with a plugin.
It has a name, can optionally prefixed by the plugin's name and may define a default value that is used when the variable is undefined.
The type parameter determines how the Neovim value is decoded.
data SettingError Source #
The errors emitted by the effect Settings
.
Unset Text | The variable is unset and has no associated default. |
Decode Text DecodeError | The variable contains data that is incompatible with the type parameter of the |
UpdateFailed Text RpcError | Something went wrong while attempting to set a variable. |
Instances
Show SettingError Source # | |
Defined in Ribosome.Data.SettingError showsPrec :: Int -> SettingError -> ShowS # show :: SettingError -> String # showList :: [SettingError] -> ShowS # | |
Eq SettingError Source # | |
Defined in Ribosome.Data.SettingError (==) :: SettingError -> SettingError -> Bool # (/=) :: SettingError -> SettingError -> Bool # | |
Reportable SettingError Source # | |
Defined in Ribosome.Data.SettingError toReport :: SettingError -> Report # |
menuMarginVertical :: Setting Float Source #
The vertical margin for floating windows used by ribosome-menu
.
menuMarginHorizontal :: Setting Float Source #
The horizontal margin for floating windows used by ribosome-menu
.
get :: forall a r. MsgpackDecode a => Member Settings r => Setting a -> Sem r a Source #
Get the value of the setting's Neovim variable or return the default if it is undefined.
update :: forall a r. MsgpackEncode a => Member Settings r => Setting a -> a -> Sem r () Source #
Set the value of the setting's Neovim variable.
or :: MsgpackDecode a => Member (Settings !! SettingError) r => a -> Setting a -> Sem r a Source #
Get the setting's value or return the supplied fallback value if the Neovim variable is undefined and the setting has no default value.