|
|
|
| Description |
| The Buffer module defines monadic editing operations over one-dimensional
buffers, maintaining a current point.
|
|
| Synopsis |
|
|
|
| Documentation |
|
|
| Constructors | | forall syntax . FBuffer !(Mode syntax) !(BufferImpl syntax) !Attributes | |
| Instances | |
|
|
|
| The BufferM monad writes the updates performed.
| | Constructors | | Instances | |
|
|
|
|
|
| Constructors | | MarkSet | | | fromMark :: !a | | | insMark :: !a | | | selMark :: !a | |
|
| Instances | |
|
|
|
|
|
|
|
| Execute a BufferM value on a given buffer and window. The new state of
the buffer is returned alongside the result of the computation.
|
|
|
|
|
| Execute a BufferM value on a given buffer, using a dummy window. The new state of
the buffer is discarded.
|
|
|
| Return the current line number
|
|
|
| Current column.
Note that this is different from offset or number of chars from sol.
(This takes into account tabs, unicode chars, etc.)
|
|
|
|
|
|
|
| Point of eof
|
|
|
| Extract the current point
|
|
|
|
|
|
|
| Return line numbers of marks
|
|
|
| Move point in buffer to the given index
|
|
|
|
|
|
|
| Move point down by n lines. n can be negative.
Returns the actual difference in lines which we moved which
may be negative if the requested line difference is negative.
|
|
|
| Move point up one line
|
|
|
| Move point down one line
|
|
|
| Create buffer named nm with contents s
|
|
|
| Constructors | | Instances | |
|
|
|
Instances | |
|
|
|
| Constructors | | Instances | |
|
|
|
| Create an overlay for the style sty between points s and e
|
|
|
| Go to line number n. n is indexed from 1. Returns the
actual line we went to (which may be not be the requested line,
if it was out of range)
|
|
|
| Go to line indexed from current point
Returns the actual moved difference which of course
may be negative if the requested difference was negative.
|
|
|
| Move point -1
|
|
|
| Move cursor +1
|
|
|
| Move point by the given number of characters.
A negative offset moves backwards a positive one forward.
|
|
|
| Move cursor -n
|
|
|
| Move cursor +n
|
|
|
| Insert the list at current point, extending size of buffer
|
|
|
| Insert the list at specified point, extending size of buffer
|
|
|
| Insert the char at current point, extending size of buffer
|
|
|
| Delete n characters forward from the current point
|
|
|
| Return n elems starting at i of the buffer as a list
|
|
|
| Write an element into the buffer at the current point.
|
|
|
| Write the list into the buffer at current point.
|
|
|
| Insert newline at current point.
|
|
|
| deleteNAt n p deletes n characters forwards from position p
|
|
|
| Read the character at the current point
|
|
|
| Return the contents of the buffer as a list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Set the given mark's point.
|
|
|
|
|
|
|
|
|
| Highlight the selection
|
|
|
|
|
| Set the mode
|
|
|
|
|
|
|
| Modify the mode
|
|
|
| Return indices of strings in buffer matched by regex in the
given region.
|
|
|
| Return indices of next string in buffer matched by regex in the
given direction
|
|
|
| Read the character at the given index
This is an unsafe operation: character NUL is returned when out of bounds
|
|
|
Given a buffer, and some information update the modeline
N.B. the contents of modelines should be specified by user, and
not hardcoded.
|
|
|
| Given a point, and the file size, gives us a percent string
|
|
|
|
|
|
|
|
|
|
|
| Mark the current point in the undo list as a saved state.
|
|
|
| Adds an overlay to the buffer
|
|
|
| Remove an existing overlay
|
|
|
|
|
| perform a BufferM a, and return to the current point. (by using a mark)
|
|
|
| perform an BufferM a, and return to the current point
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Revert all the pending updates; don't touch the point.
|
|
|
|
|
| udpate the syntax information (clear the dirty flag)
|
|
|
|
|
| A Mode customizes the Yi interface for editing a particular data
format. It specifies when the mode should be used and
controls file-specific syntax highlighting and command input, among
other things.
| | Constructors | | Mode | | | modeName :: String | so this can be serialized, debugged.
| | modeApplies :: FilePath -> String -> Bool | What type of files does this mode apply to?
| | modeHL :: ExtHL syntax | Syntax highlighter
| | modePrettify :: syntax -> BufferM () | Prettify current "paragraph"
| | modeKeymap :: KeymapSet -> KeymapSet | Buffer-local keymap modification
| | modeIndent :: syntax -> IndentBehaviour -> BufferM () | emacs-style auto-indent line
| | modeAdjustBlock :: syntax -> Int -> BufferM () | adjust the indentation after modification
| | modeFollow :: syntax -> Action | Follow a "link" in the file. (eg. go to location of error message)
| | modeIndentSettings :: IndentSettings | | | modeToggleCommentSelection :: BufferM () | | | modeGetStrokes :: syntax -> Point -> Point -> Point -> [Stroke] | Strokes that should be applied when displaying a syntax element
| | modeGetAnnotations :: syntax -> Point -> [Span String] | | | modePrintTree :: syntax -> BufferM () | | | modeOnLoad :: BufferM () | An action that is to be executed when this mode is set
|
|
| Instances | |
|
|
|
| Constructors | | forall syntax . AnyMode (Mode syntax) | |
| Instances | |
|
|
|
| Used to specify the behaviour of the automatic indent command.
| | Constructors | | IncreaseCycle | Increase the indentation to the next higher indentation
hint. If we are currently at the highest level of
indentation then cycle back to the lowest.
| | DecreaseCycle | Decrease the indentation to the next smaller indentation
hint. If we are currently at the smallest level then
cycle back to the largest
| | IncreaseOnly | Increase the indentation to the next higher hint
if no such hint exists do nothing.
| | DecreaseOnly | Decrease the indentation to the next smaller indentation
hint, if no such hint exists do nothing.
|
| Instances | |
|
|
|
| Currently duplicates some of Vim's indent settings. Allowing a buffer to
- specify settings that are more dynamic, perhaps via closures, could be
- useful.
| | Constructors | | IndentSettings | | | expandTabs :: Bool | Insert spaces instead of tabs as possible
| | tabSize :: Int | Size of a Tab
| | shiftWidth :: Int | Indent by so many columns
|
|
| Instances | |
|
|
|
| Mode applies function that always returns True.
|
|
|
| Mode applies function that always returns False.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Use in readonly!
|
|
|
Access to a value into the extensible state, keyed by its type.
This allows you to save or retrieve inside a BufferM monad, ie:
putA bufferDynamicValueA updatedvalue
value <- getA bufferDynamicValueA
|
|
|
|
|
|
|
|
|
|
|
| maybe a filename associated with this buffer. Filename is canonicalized.
|
|
|
|
|
|
| Produced by Haddock version 2.6.1 |