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

Ribosome.Api.Window

Description

API functions for windows.

Synopsis

Documentation

closeWindow :: Member Rpc r => Window -> Sem r () Source #

Close a window if it is valid and not the last one.

cursor :: Member Rpc r => Window -> Sem r (Int, Int) Source #

Get the zero-based position of the cursor in a window.

currentCursor :: Member Rpc r => Sem r (Int, Int) Source #

Get the zero-based position of the cursor in the active window.

windowLine :: Member Rpc r => Window -> Sem r Int Source #

Get the zero-based line number of the cursor in a window.

currentLine :: Member Rpc r => Sem r Int Source #

Get the zero-based line number of the cursor in the active window.

setCursor :: Member Rpc r => Window -> Int -> Int -> Sem r () Source #

Set the zero-based position of the cursor in a window.

setCurrentCursor :: Member Rpc r => Int -> Int -> Sem r () Source #

Set the zero-based position of the cursor in the current window.

setLine :: Member Rpc r => Window -> Int -> Sem r () Source #

Set the zero-based line number of the cursor in a window, using the beginning of the line for the column.

setCurrentLine :: Member Rpc r => Int -> Sem r () Source #

Set the zero-based line number of the cursor in the current window, using the beginning of the line for the column.

redraw :: Member Rpc r => Sem r () Source #

Redraw the screen.

findMainWindow :: Member Rpc r => Sem r (Maybe Window) Source #

A main window means here any non-window that may be used to edit a file, i.e. one with an empty buftype.

ensureMainWindow :: Member Rpc r => Sem r Window Source #

Create a new window at the top if no existing window has empty buftype. Focuses the window.

saveView :: Member Rpc r => Sem r WindowView Source #

Call winsaveview.

restoreView :: Member Rpc r => PartialWindowView -> Sem r () Source #

Call winrestview with a previously obtained view from saveView.

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

Execute a command in a window.