ribosome-0.9.9.9: Neovim plugin framework for Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ribosome.Api.Buffer

Description

API functions for buffers.

Synopsis

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.

wipeBuffer :: Member Rpc r => Buffer -> Sem r () Source #

Force-wipe a buffer, discarding changes.

unloadBuffer :: Member Rpc r => Buffer -> Sem r () Source #

Force-unload a buffer, discarding changes.

addBuffer :: Member Rpc r => Text -> Sem r () Source #

Add a buffer to the list without loading it.

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.

currentBufferName :: Member Rpc r => Sem r Text Source #

Return the name of the current buffer.

setCurrentBuffer :: Member Rpc r => Buffer -> Sem r () Source #

Set the current buffer.

bufferIsFile :: Member Rpc r => Buffer -> Sem r Bool Source #

Indicate whether the given buffer is a file, i.e. has empty buftype.

bufferCount :: Member Rpc r => Sem r Natural Source #

Return the number of buffers in the list.

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.

currentBufferPath :: Member Rpc r => Sem r (Maybe (Path Abs File)) Source #

Return the file system path of the current buffer, if its name is a valid path.

filterListed :: Member Rpc r => [Buffer] -> Sem r [Buffer] Source #

Filter out the unlisted buffers from the given list.