Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
API functions for buffers.
Synopsis
- edit :: Member Rpc r => Path b t -> Sem r ()
- buflisted :: Member (Rpc !! RpcError) r => Buffer -> Sem r Bool
- bufferContent :: Member Rpc r => Buffer -> Sem r [Text]
- currentBufferContent :: Member Rpc r => Sem r [Text]
- setBufferContent :: Member Rpc r => Buffer -> [Text] -> Sem r ()
- setCurrentBufferContent :: Member Rpc r => [Text] -> Sem r ()
- setBufferLine :: Member Rpc r => Buffer -> Int -> Text -> Sem r ()
- whenValid :: Member Rpc r => (Buffer -> Sem r ()) -> Buffer -> Sem r ()
- withBufferNumber :: Member Rpc r => (Int -> Sem r ()) -> Buffer -> Sem r ()
- closeBuffer :: Member Rpc r => Buffer -> Sem r ()
- wipeBuffer :: Member Rpc r => Buffer -> Sem r ()
- unloadBuffer :: Member Rpc r => Buffer -> Sem r ()
- addBuffer :: Member Rpc r => Text -> Sem r ()
- fileBuffer :: Path Abs Dir -> Buffer -> Text -> Maybe FileBuffer
- fileBuffers :: Member Rpc r => Sem r [FileBuffer]
- bufferForFile :: Member Rpc r => Path Abs File -> Sem r (Maybe FileBuffer)
- currentBufferName :: Member Rpc r => Sem r Text
- setCurrentBuffer :: Member Rpc r => Buffer -> Sem r ()
- bufferIsFile :: Member Rpc r => Buffer -> Sem r Bool
- bufferCount :: Member Rpc r => Sem r Natural
- bufferPath :: Member Rpc r => Buffer -> Sem r (Maybe (Path Abs File))
- currentBufferPath :: Member Rpc r => Sem r (Maybe (Path Abs File))
- filterListed :: Member Rpc r => [Buffer] -> Sem r [Buffer]
Documentation
edit :: Member Rpc r => Path b t -> Sem r () Source #
Load a Path
into a buffer in the current window using :edit
.
buflisted :: Member (Rpc !! RpcError) r => Buffer -> Sem r Bool Source #
Call the Neovim function buflisted
for a buffer, indicating whether it is shown in the buffer list (:ls
).
bufferContent :: Member Rpc r => Buffer -> Sem r [Text] Source #
Return the entire content of the given buffer.
currentBufferContent :: Member Rpc r => Sem r [Text] Source #
Return the entire content of the current buffer.
setBufferContent :: Member Rpc r => Buffer -> [Text] -> Sem r () Source #
Replace the content of the given buffer.
setCurrentBufferContent :: Member Rpc r => [Text] -> Sem r () Source #
Replace the content of the current buffer.
setBufferLine :: Member Rpc r => Buffer -> Int -> Text -> Sem r () Source #
Replace a single line in the given buffer.
whenValid :: Member Rpc r => (Buffer -> Sem r ()) -> Buffer -> Sem r () Source #
Execute an action only if the given buffer is valid, i.e. it exists but may be unloaded.
withBufferNumber :: Member Rpc r => (Int -> Sem r ()) -> Buffer -> Sem r () Source #
Execute an action with the given buffer's number if it is valid.
closeBuffer :: Member Rpc r => Buffer -> Sem r () Source #
Force-delete a buffer, discarding changes.
unloadBuffer :: Member Rpc r => Buffer -> Sem r () Source #
Force-unload a buffer, discarding changes.
fileBuffer :: Path Abs Dir -> Buffer -> Text -> Maybe FileBuffer Source #
Construct a file buffer from a path if it is parseable.
fileBuffers :: Member Rpc r => Sem r [FileBuffer] Source #
Get all buffers in the buffer list whose name is a path.
bufferForFile :: Member Rpc r => Path Abs File -> Sem r (Maybe FileBuffer) Source #
Find the buffer whose name is the given path.
bufferIsFile :: Member Rpc r => Buffer -> Sem r Bool Source #
Indicate whether the given buffer is a file, i.e. has empty buftype
.
bufferPath :: Member Rpc r => Buffer -> Sem r (Maybe (Path Abs File)) Source #
Return the file system path of the given buffer, if its name is a valid path.