|
|
|
Description |
The top level editor state, and operations on it.
|
|
Synopsis |
|
|
|
Documentation |
|
|
|
|
|
|
The Editor state
| Constructors | Editor | | bufferStack :: ![BufferRef] | Stack of all the buffers.
Invariant: never empty
Invariant: first buffer is the current one.
| buffers :: !(Map BufferRef FBuffer) | | refSupply :: !Int | Supply for buffer and window ids.
| tabs_ :: !(PointedList (PointedList Window)) | current tab contains the visible windows pointed list.
| dynamic :: !DynamicValues | dynamic components
| statusLines :: !Statuses | | maxStatusHeight :: !Int | | killring :: !Killring | | currentRegex :: !(Maybe SearchExp) | currently highlighted regex (also most recent regex for use in vim bindings)
| searchDirection :: !Direction | | pendingEvents :: ![Event] | Processed events that didn't yield any action yet.
| onCloseActions :: !(Map BufferRef (EditorM ())) | Actions to be run when the buffer is closed; should be scrapped.
|
|
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
|
|
|
The initial state
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:: BufferId | The buffer indentifier
| -> Rope | The contents with which to populate the buffer
| -> EditorM BufferRef | | Create and fill a new buffer, using contents of string.
| Does not focus the window, or make it the current window.
| Call newWindowE or switchToBufferE to take care of that.
|
|
|
|
|
|
|
|
|
|
Delete a buffer (and release resources associated with it).
|
|
|
Return the buffers we have, in no particular order
|
|
|
Return a prefix that can be removed from all buffer paths while keeping them
unique.
|
|
|
|
|
|
|
Find buffer with this key
|
|
|
Find buffer with this name
|
|
|
Find buffer with given name. Fail if not found.
|
|
|
Make all buffers visible by splitting the current window list.
FIXME: rename to displayAllBuffersE; make sure buffers are not open twice.
|
|
|
Rotate the buffer stack by the given amount.
|
|
|
Perform action with any given buffer, using the last window that was used for that buffer.
|
|
|
Perform action with any given buffer
|
|
|
Perform action with current window's buffer
|
|
|
|
|
Return the current buffer
|
|
|
Display a transient message
|
|
|
|
|
|
|
Set the background status line
|
|
|
Clear the status line
|
|
|
|
|
|
|
|
|
Put string into yank register
|
|
|
Return the contents of the yank register
|
|
|
Dynamically-extensible state components.
These hooks are used by keymaps to store values that result from
Actions (i.e. that restult from IO), as opposed to the pure values
they generate themselves, and can be stored internally.
The dynamic field is a type-indexed map.
Retrieve a value from the extensible state
|
|
|
Insert a value into the extensible state, keyed by its type
|
|
|
Attach the next buffer in the buffer stack to the current window.
|
|
|
Attach the previous buffer in the stack list to the current window.
|
|
|
:: BufferId | buffer name
| -> Rope | buffer contents
| -> EditorM BufferRef | | Like fnewE, create a new buffer filled with the String s,
Switch the current window to this buffer. Doesn't associate any file
with the buffer (unlike fnewE) and so is good for popup internal
buffers (like scratch)
|
|
|
|
Creates an in-memory buffer with a unique name.
A hint for the buffer naming scheme can be specified in the dynamic variable TempBufferNameHint
The new buffer always has a buffer ID that did not exist before newTempBufferE.
TODO: this probably a lot more complicated than it should be: why not count from zero every time?
|
|
data TempBufferNameHint | Source |
|
Specifies the hint for the next temp buffer's name.
| Constructors | | Instances | |
|
|
|
|
|
Create a new window onto the given buffer.
|
|
|
Attach the specified buffer to the current window
|
|
|
Attach the specified buffer to some other window than the current one
|
|
|
Switch to the buffer specified as parameter. If the buffer name is empty, switch to the next buffer.
|
|
|
Close a buffer.
Note: close the current buffer if the empty string is given
|
|
|
|
|
Close current buffer and window, unless it's the last one.
|
|
|
Rotate focus to the next window
|
|
|
Rotate focus to the previous window
|
|
|
A fake accessor that fixes the current buffer after a change of the current
window.
Enforces invariant that top of buffer stack is the buffer of the current window.
|
|
|
Counterpart of fixCurrentBufferA_: fix the current window to point to the
right buffer.
|
|
|
|
|
|
|
Return the windows that are currently open on the buffer whose key is given
|
|
|
bring the editor focus the window with the given key.
Fails if no window with the given key is found.
|
|
|
Split the current window, opening a second window onto current buffer.
TODO: unfold newWindowE here?
|
|
|
Enlarge the current window
|
|
|
Shrink the current window
|
|
|
Creates a new tab containing a window that views the current buffer.
|
|
|
Moves to the next tab in the round robin set of tabs
|
|
|
Moves to the previous tab in the round robin set of tabs
|
|
|
Moves the focused tab to the given index, or to the end if the index is not specified.
|
|
|
Deletes the current tab. If there is only one tab open then error out.
When the last tab is focused, move focus to the left, otherwise
move focus to the right.
|
|
|
Close the current window. If there is only one tab open and the tab
contains only one window then do nothing.
|
|
|
Make the current window the only window on the screen
|
|
|
Switch focus to some other window. If none is available, create one.
|
|
|
Execute the argument in the context of an other window. Create
one if necessary. The current window is re-focused after the
argument has completed.
|
|
|
|
|
Defines an action to be executed when the current buffer is closed.
Used by the minibuffer to assure the focus is restored to the buffer that spawned the minibuffer.
todo: These actions are not restored on reload.
todo: These actions should probably be very careful at what they do.
TODO: All in all, this is a very ugly way to achieve the purpose. The nice way to proceed
is to somehow attach the miniwindow to the window that has spawned it.
|
|
Produced by Haddock version 2.6.1 |