A buffer could be considered a slider (see slider) with some extra attributes, besides attributes to keep track of name, filename, dirtyness, undo information it consists of
The slider is used to keep track of the text, the highlighter function is used by the view to apply highlight and the keymap is used to decide which function a keypress should be mapped to.
On runtime the highlighter function and the keymap can be replaced.
The buffer structure is immutable, so every operation that changes the buffer will return a new one.
A buffer could be considered a slider (see slider) with some extra attributes, besides attributes to keep track of name, filename, dirtyness, undo information it consists of * A slider * A highlighter function * A keymap The slider is used to keep track of the text, the highlighter function is used by the view to apply highlight and the keymap is used to decide which function a keypress should be mapped to. On runtime the highlighter function and the keymap can be replaced. The buffer structure is immutable, so every operation that changes the buffer will return a new one.
(apply-to-slider buffer fun)
Apply function to the slider in the buffer. It should take a slider as input and produce a slider as output.
Apply function to the slider in the buffer. It should take a slider as input and produce a slider as output.
(backward-visual-line buffer columns)
Returns a buffer where the cursor has been moved backward one visual (soft) line, taking wrap at given columns into account.
Returns a buffer where the cursor has been moved backward one visual (soft) line, taking wrap at given columns into account.
(create name)
Creates an empty buffer with the given name.
Creates an empty buffer with the given name.
(create-from-file path)
Creates a buffer and loads the content of a given file. The filename is stored also, to be used for save functionality.
Creates a buffer and loads the content of a given file. The filename is stored also, to be used for save functionality.
(dirty? buffer)
Returns the dirty state of the buffer.
Returns the dirty state of the buffer.
(find-next buffer search)
Returns a new buffer where the cursor is moved to the next occurrence of the search frase.
Returns a new buffer where the cursor is moved to the next occurrence of the search frase.
(force-reopen-file buffer)
Reopening file in buffer, ignore dirty flag.
Reopening file in buffer, ignore dirty flag.
(forward-visual-line buffer columns)
Returns a buffer where the cursor has been moved forward one visual (soft) line, taking wrap at given columns into account.
Returns a buffer where the cursor has been moved forward one visual (soft) line, taking wrap at given columns into account.
(get-action buffer keyw)
If the keymap has an action (function) for the given keyword, it will be returned.
If the keymap has an action (function) for the given keyword, it will be returned.
(get-filename buffer)
Returns the filename associated with the buffer.
Returns the filename associated with the buffer.
(get-highlighter buffer)
Returns the highlighter function associated with the buffer.
Returns the highlighter function associated with the buffer.
(get-keymap buffer)
Returns the keymap associated with the buffer.
Returns the keymap associated with the buffer.
(get-name buffer)
Returns the name associated with the buffer.
Returns the name associated with the buffer.
(get-slider buffer)
Returns the slider in the buffer datastructure. The slider is responsible for storing and manipulating the text in the buffer.
Returns the slider in the buffer datastructure. The slider is responsible for storing and manipulating the text in the buffer.
(reopen-file buffer)
Reopen file in buffer, if the file is not dirty.
Reopen file in buffer, if the file is not dirty.
(save-buffer buffer)
If there is a filename connected with the buffer, the content of the buffer will be saved to that file.
If there is a filename connected with the buffer, the content of the buffer will be saved to that file.
(set-dirty buffer)
(set-dirty buffer dirty)
Sets dirty flag on the buffer. Used to mark if content has changed since last save.
Sets dirty flag on the buffer. Used to mark if content has changed since last save.
(set-highlighter buffer highlighter)
Returns a new buffer with the given highlighter set.
Returns a new buffer with the given highlighter set.
(set-keymap buffer keymap)
Returns a new buffer with the given keymap set.
Returns a new buffer with the given keymap set.
(set-point buffer point)
Returns a new buffer where the cursor has been moved to the given point.
Returns a new buffer where the cursor has been moved to the given point.
(set-undo-point buffer)
Return new buffer with the current slider to the undo stack.
Return new buffer with the current slider to the undo stack.
(undo buffer)
Returns the first buffer in the undo stack.
Returns the first buffer in the undo stack.
(update-mem-col buffer columns)
The mem-col is the column position of the cursor, from the last time the cursor was moved not up and down.
When moving the cursor up and down and passing by shorter lines the column position, when reaching a longer line again, should be restored.
This allows one to keep the current column and avoid the cursor from staying at the beginning of the line when passing an empty line.
The mem-col is the column position of the cursor, from the last time the cursor was moved not up and down. When moving the cursor up and down and passing by shorter lines the column position, when reaching a longer line again, should be restored. This allows one to keep the current column and avoid the cursor from staying at the beginning of the line when passing an empty line.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close