The editor is the central point of Liquid. Most of the data is immutable, but the editor has a ref, also called editor. It contains the state of the editor.
Most actions on the editor will replace content of this state with a transformed content.
For example:
When (forward-char 1) is called, the current buffer will be replaced with a new buffer, where the cursor is moved one char ahead.
The editor is the central point of Liquid. Most of the data is immutable, but the editor has a ref, also called editor. It contains the state of the editor. Most actions on the editor will replace content of this state with a transformed content. For example: When (forward-char 1) is called, the current buffer will be replaced with a new buffer, where the cursor is moved one char ahead.
(add-command fun)
Add a command to be availble for commandapp typeahead. add-interactive is in most cases more suitable.
Add a command to be availble for commandapp typeahead. add-interactive is in most cases more suitable.
(add-file f)
Add a single file to be availalbe through typeahead from the commandapp. When chosen the file will be opened. EXAMPLE: (editor/add-file "/home/mogens/.liq")
Add a single file to be availalbe through typeahead from the commandapp. When chosen the file will be opened. EXAMPLE: (editor/add-file "/home/mogens/.liq")
(add-interactive label fun & arglabels)
Add an interactive function. The label will be shown in typeahead. The user will be prompted to provide and input for each of the lables in arglabels. The function will be called with the input values as arguments.
Add an interactive function. The label will be shown in typeahead. The user will be prompted to provide and input for each of the lables in arglabels. The function will be called with the input values as arguments.
(add-rootfolder s)
Add a folder to rootfolders. When using find file app, the rootfolders can be directly accessed through typeahead. EXAMPLE: (editor/add-rootfolder "/tmp")
Add a folder to rootfolders. When using find file app, the rootfolders can be directly accessed through typeahead. EXAMPLE: (editor/add-rootfolder "/tmp")
(add-searchpath s)
Add a folder to searchpaths. When using the commandapp files below folders in the searchpath will be available through typeahead. EXAMPLE: (editor/add-searchpath "/tmp")
Add a folder to searchpaths. When using the commandapp files below folders in the searchpath will be available through typeahead. EXAMPLE: (editor/add-searchpath "/tmp")
(add-snippet s)
Add a snippet to list of snippets. They will be available through typeahead from the commandapp. When chosen the snippet text will be inserted. EXAMPLE: (editor/add-snippet "(ns user)")
Add a snippet to list of snippets. They will be available through typeahead from the commandapp. When chosen the snippet text will be inserted. EXAMPLE: (editor/add-snippet "(ns user)")
(add-to-setting keyw entry)
When a setting with a given key is a list, items can be added to that list using this function.
When a setting with a given key is a list, items can be added to that list using this function.
(add-window window)
(add-window name top left rows columns buffername)
Add a window to the editor. It takes as input a window created using dk.salza.liq.window/create function.
Add a window to the editor. It takes as input a window created using dk.salza.liq.window/create function.
(apply-to-slider fun)
Apply function to the slider in the current buffer. It should take a slider as input and produce a slider as output.
Apply function to the slider in the current buffer. It should take a slider as input and produce a slider as output.
(backward-char)
(backward-char amount)
Moves the cursor backward the given amount, or 1 step, if no arguments are given.
Moves the cursor backward the given amount, or 1 step, if no arguments are given.
(backward-line)
Moves cursor backward one line in the current active buffer.
Moves cursor backward one line in the current active buffer.
(backward-word)
Moves the cursor to the beginning of the previous word.
Moves the cursor to the beginning of the previous word.
(beginning-of-buffer)
Moves the cursor to the beginning of the buffer.
Moves the cursor to the beginning of the buffer.
(beginning-of-line)
Moves the cursor to the beginning of the current line.
Moves the cursor to the beginning of the current line.
(buffer-names)
The names of the buffers as a list
The names of the buffers as a list
(changed-on-disk?)
If the current buffer is from a file, it returns if the file has changed on the disk, maybe by another program.
If the current buffer is from a file, it returns if the file has changed on the disk, maybe by another program.
(copy-context)
Send the context to the clipboard. The context could be a filename, a function, an url depending on how the context is resolved.
Send the context to the clipboard. The context could be a filename, a function, an url depending on how the context is resolved.
(copy-file)
If the current buffer is connected to a file, the filename is send to the clipboard.
If the current buffer is connected to a file, the filename is send to the clipboard.
(copy-line)
Sends the current line to the clipboard.
Sends the current line to the clipboard.
(copy-selection)
If there is a selection, the selected text will be send to clipboard.
If there is a selection, the selected text will be send to clipboard.
(create-buffer-from-file filepath)
Creates a new buffer, connects it to the given filepath and loads the content into the buffer.
Creates a new buffer, connects it to the given filepath and loads the content into the buffer.
(current-buffer)
Returns the current active buffer. Since buffers are immutable, this will be a copy of the actual buffer.
Returns the current active buffer. Since buffers are immutable, this will be a copy of the actual buffer.
(current-window)
Get the current active window. Mostly used to get the dimensions for the related buffer.
Get the current active window. Mostly used to get the dimensions for the related buffer.
(delete)
(delete amount)
Deletes given amount of characters backwards. If no amount is supplied just one character will be deleted.
Deletes given amount of characters backwards. If no amount is supplied just one character will be deleted.
(delete-char)
Deletes the character after the cursor.
Deletes the character after the cursor.
(delete-selection)
If there is a selection, the selected content will be deleted.
If there is a selection, the selected content will be deleted.
(dirty-buffers)
The names of the dirty buffers as a list.
The names of the dirty buffers as a list.
(dirty?)
Returns weather current buffer is dirty.
Returns weather current buffer is dirty.
(drop-tmp-keymap)
Drop the current temporary keymap.
Drop the current temporary keymap.
The ref which contains the editor data, that is
Most functions in the editor namespace manipulates this ref.
The ref which contains the editor data, that is * List of buffers * List of windows * Global keymap * Map of functions to evaluate different filetypes * Settings with searchpaths, searchfiles, snippets, commands and interactive commands for typeahead. Most functions in the editor namespace manipulates this ref.
(end-of-buffer)
Moved the cursor to the end of the buffer.
Moved the cursor to the end of the buffer.
(end-of-buffer?)
Returns true of the current point is the end of the current buffer.
Returns true of the current point is the end of the current buffer.
(end-of-line)
Moves the cursor to the end of the current line. The next hard line break.
Moves the cursor to the end of the current line. The next hard line break.
(end-of-word)
Moves the cursor to the end of the current word.
Moves the cursor to the end of the current word.
(eval-last-sexp)
Evaluate the current s-expression.
Evaluate the current s-expression.
(eval-safe fun)
Evaluate a function, catching errors if thrown.
Evaluate a function, catching errors if thrown.
(eval-sexp sexp)
Evaluate the given s-expression in the current namespace.
Evaluate the given s-expression in the current namespace.
(evaluate-file)
(evaluate-file filepath)
Evaluate the given file. How evaluation is done depends on the file type.
Evaluate the given file. How evaluation is done depends on the file type.
(evaluate-file-raw)
(evaluate-file-raw filepath)
Evaluate a given file raw, without using with-out-str or other injected functionality. If no filepath is supplied the path connected to the current buffer will be used.
Evaluate a given file raw, without using with-out-str or other injected functionality. If no filepath is supplied the path connected to the current buffer will be used.
(find-file filepath)
Opens the file with the given name with the default app.
Opens the file with the given name with the default app.
(force-reopen-file)
Reopening file in buffer, ignore dirty flag.
Reopening file in buffer, ignore dirty flag.
(forward-char)
(forward-char amount)
Moves the cursor forward the given amount, or 1 step, if no arguments are given.
Moves the cursor forward the given amount, or 1 step, if no arguments are given.
(forward-line)
Moves cursor forward one line in the current active buffer.
Moves cursor forward one line in the current active buffer.
(forward-page)
Moves one page forward on the current buffer. A page is what is visible in the current window.
Moves one page forward on the current buffer. A page is what is visible in the current window.
(forward-word)
Moves the cursor to the beginning of the next word.
Moves the cursor to the beginning of the next word.
(fullupdate?)
If a full update of the ui has been requested. Resets the value afterwards.
If a full update of the ui has been requested. Resets the value afterwards.
(get-action keyw)
If the current buffer has an action for the given keyword the action (function) is return, otherwise, if there is a global action for the given keyword that will be returned.
If the current buffer has an action for the given keyword the action (function) is return, otherwise, if there is a global action for the given keyword that will be returned.
(get-buffer name)
Get a buffer by its name. Since buffers are immutable, the buffer given will be a copy of the buffer.
Get a buffer by its name. Since buffers are immutable, the buffer given will be a copy of the buffer.
(get-char)
Return the char at the point as a string.
Return the char at the point as a string.
(get-content)
Return the content of the current buffer as a string.
Return the content of the current buffer as a string.
(get-context)
Returns a context map like {:type :file :value /tmp/tmp.txt} with a type and a value generated by analysing the context of the cursor.
Returns a context map like {:type :file :value /tmp/tmp.txt} with a type and a value generated by analysing the context of the cursor.
(get-default-app)
Get the app to be used as default, if none has been specified.
Get the app to be used as default, if none has been specified.
(get-default-highlighter)
Get the default highlighter function. Mostly used to set highlight on buffer until some is set by user or app.
Get the default highlighter function. Mostly used to set highlight on buffer until some is set by user or app.
(get-default-typeahead-function)
Get the default function for typeahead.
Get the default function for typeahead.
(get-filename)
The filename if one is associated with the current buffer, otherwise nil.
The filename if one is associated with the current buffer, otherwise nil.
(get-folder)
The folder part if a filename is associated with the current buffer, otherwise nil.
The folder part if a filename is associated with the current buffer, otherwise nil.
(get-frame-columns)
Get the number of columns in the current frame.
Get the number of columns in the current frame.
(get-frame-rows)
Get the number of rows in the current frame.
Get the number of rows in the current frame.
(get-highlighter)
Returns the highlighter function from the current buffer.
Returns the highlighter function from the current buffer.
(get-keymap)
Returns the active keymap on from the current buffer. This is used by the editor to determine what action to take.
Returns the active keymap on from the current buffer. This is used by the editor to determine what action to take.
(get-line)
Returns the current line as a string.
Returns the current line as a string.
(get-mark name)
Returns the named mark on the current buffer as a number, the position of the mark.
Returns the named mark on the current buffer as a number, the position of the mark.
(get-name)
Returns the name of the current buffer.
Returns the name of the current buffer.
(get-point)
Returns the point as a number.
Returns the point as a number.
(get-rootfolders)
Returns the list of root folders. Used by apps to navigate directly to these folders.
Returns the list of root folders. Used by apps to navigate directly to these folders.
(get-searchpaths)
Returns the list of searchpaths.
Returns the list of searchpaths.
(get-selection)
Get current selected text as a string. Returns nil if nothing is selected.
Get current selected text as a string. Returns nil if nothing is selected.
(get-slider)
Get the slider from the current buffer.
Get the slider from the current buffer.
(get-top-of-window keyw)
Used by renderer to get the position of the first char to be rendered.
Used by renderer to get the position of the first char to be rendered.
(get-windows)
Returns the list of windows in the editor. Used by views to get the dimensions of the visible buffers.
Returns the list of windows in the editor. Used by views to get the dimensions of the visible buffers.
(hide-selection)
Hide the current selection. Will be collapsed into a symbol with 3 dots.
Hide the current selection. Will be collapsed into a symbol with 3 dots.
(highlight-sexp-at-point)
Like select-sexp-at-point but only highlights start and end of s-expression. Toggle this to see current s-expression.
Like select-sexp-at-point but only highlights start and end of s-expression. Toggle this to see current s-expression.
(insert string)
Inserts a string to the current active buffer at the cursor position.
Inserts a string to the current active buffer at the cursor position.
(insert-line)
Inserts an empty line below the current and move the cursor down.
Inserts an empty line below the current and move the cursor down.
(new-buffer name)
Create a new buffer with the given name. The buffer will be set as the current buffer in the current window. Default highlighter and keymaps are assign. They can be overridden afterwards.
Create a new buffer with the given name. The buffer will be set as the current buffer in the current window. Default highlighter and keymaps are assign. They can be overridden afterwards.
(other-window)
Navigates to the next window and changes buffer accordingly.
Navigates to the next window and changes buffer accordingly.
(paste)
Insert the text from the clipboard at the current position.
Insert the text from the clipboard at the current position.
(point-to-mark name)
Move the point to the mark on the current buffer.
Move the point to the mark on the current buffer.
(previous-buffer)
Navigates to the previous buffer used.
Navigates to the previous buffer used.
(previous-real-buffer)
Navigates to the prevous buffer, but skip over buffer with names containing dashes.
Navigates to the prevous buffer, but skip over buffer with names containing dashes.
(previous-real-buffer-same-window)
Navigates to the prevous buffer, but skip over buffer with names containing dashes.
Navigates to the prevous buffer, but skip over buffer with names containing dashes.
(prompt-append & string)
Append the given strings to the prompt buffer.
Append the given strings to the prompt buffer.
(prompt-set & string)
Set the prompt buffer to the given strings.
Set the prompt buffer to the given strings.
(remove-mark name)
Removes the named mark from the current buffer.
Removes the named mark from the current buffer.
(reopen-all-files)
Reopen all files which are not dirty.
Reopen all files which are not dirty.
(reopen-file)
Reopen file in buffer, if the file is not dirty.
Reopen file in buffer, if the file is not dirty.
(replace-char s)
Replaces the char at current point with the given one.
Replaces the char at current point with the given one.
(request-fullupdate)
Used notify the ui to do a full updated.
Used notify the ui to do a full updated.
(reset)
Resets the editor. Mostly for testing purposes.
Resets the editor. Mostly for testing purposes.
(save-file)
If the current buffer is connected to a file, saves the content of the buffer to the file.
If the current buffer is connected to a file, saves the content of the buffer to the file.
(select-sexp-at-point)
Selects the s-expression at the point (cursor) The cursor is moved backwards until the first startparenthesis where selection starts, and then forward until the selection has balanced parenthesis.
Selects the s-expression at the point (cursor) The cursor is moved backwards until the first startparenthesis where selection starts, and then forward until the selection has balanced parenthesis.
(selection-active?)
If something is selected.
If something is selected.
(selection-cancel)
Removes the selection point. Nothing will be selected afterwards.
Removes the selection point. Nothing will be selected afterwards.
(selection-set)
Sets selection mark at the current point. This will be the starting point of a selection. Cursor position will be the end point of the selection.
Sets selection mark at the current point. This will be the starting point of a selection. Cursor position will be the end point of the selection.
(selection-toggle)
If something is selected, the selection will be cancelled. If nothing is selected a selection will be initiated.
If something is selected, the selection will be cancelled. If nothing is selected a selection will be initiated.
(set-default-app app)
Set the default app to be used when a new buffer is created.
Set the default app to be used when a new buffer is created.
(set-default-highlighter highlighter)
Set the highlighter function to be used as default when a new buffer is created.
Set the highlighter function to be used as default when a new buffer is created.
(set-default-keymap keymap)
Set the keymap to be used as default when a new buffer is created.
Set the keymap to be used as default when a new buffer is created.
(set-default-typeahead-function typeaheadfn)
Set the typeahead function to be used of none has been set.
Set the typeahead function to be used of none has been set.
(set-eval-function extension fun)
Associate an extension with a function. The function is assumed to take one input - the filepath. EXAMPLE (To associate files with "py" extension with the python command): (editor/set-eval-function "py" #(cshell/cmd "python" %))
Associate an extension with a function. The function is assumed to take one input - the filepath. EXAMPLE (To associate files with "py" extension with the python command): (editor/set-eval-function "py" #(cshell/cmd "python" %))
(set-frame-dimensions rows columns)
Setting rows and columns of the window frame.
Setting rows and columns of the window frame.
(set-global-key keyw fun)
(set-global-key keyw1 keyw2 fun)
Define a global keybinding. It takes a keyword like :f5 and a function to call when that key is pressed.
Define a global keybinding. It takes a keyword like :f5 and a function to call when that key is pressed.
(set-highlighter highlighter)
Set the highlighter function on the current buffer. This determines how the content in the buffer is syntax highlighted.
Set the highlighter function on the current buffer. This determines how the content in the buffer is syntax highlighted.
(set-keymap keymap)
Sets the keymap on the current buffer.
Sets the keymap on the current buffer.
(set-mark name)
Sets a named mark at the current point on the current buffer
Sets a named mark at the current point on the current buffer
(set-setting keyw value)
Set keyw to value in the settings part of the editor.
Set keyw to value in the settings part of the editor.
(set-slider sl)
Replace the slider in the current buffer with the given.
Replace the slider in the current buffer with the given.
(set-tmp-keymap keymap)
Overrule the current keymap temporarily. This keymap has highest priority.
Overrule the current keymap temporarily. This keymap has highest priority.
(set-top-of-window keyw val)
Used by the renderer to store the position of the first char to be rendered.
Used by the renderer to store the position of the first char to be rendered.
(setting keyw)
Get the setting with the given key.
Settings are used as a key value store in the editor.
Items like snippets or search paths are store in this.
Get the setting with the given key. Settings are used as a key value store in the editor. Items like snippets or search paths are store in this.
(sexp-at-point)
Returns the s-expression at the cursor position.
Returns the s-expression at the cursor position.
(swap-line-down)
Swaps the current line with the one below. The cursor follows the the current line down.
Swaps the current line with the one below. The cursor follows the the current line down.
(swap-line-up)
Swaps the current line with the line above. The cursor follows the current line up.
Swaps the current line with the line above. The cursor follows the current line up.
(switch-to-buffer buffername)
Switch to the buffer with the given name.
Switch to the buffer with the given name.
(switch-to-buffer-same-window buffername)
Switch to the buffer with the given name. Use the same window.
Switch to the buffer with the given name. Use the same window.
(top-align-page)
Scrolls so the current line is at the top of the window.
Scrolls so the current line is at the top of the window.
Atom to keep track of the position of the first char visible in a window. Keys are generated from window and buffer names.
Atom to keep track of the position of the first char visible in a window. Keys are generated from window and buffer names.
(undo)
Execute an undo on the current buffer.
Execute an undo on the current buffer.
(unhide)
If the current position has collapsed content it will be expanded.
If the current position has collapsed content it will be expanded.
(update-mem-col)
Stores the current cursor position on the current line. Primarily used for forward-line and backward-line to remember the cursor position when navigation is done past shorter lines. That is what makes the cursor in and out when using arrow down.
Stores the current cursor position on the current line. Primarily used for forward-line and backward-line to remember the cursor position when navigation is done past shorter lines. That is what makes the cursor in and out when using arrow down.
(updated)
Call this function to proclaim that an update has been made to the editor. This can be used by views to check for updates.
Call this function to proclaim that an update has been made to the editor. This can be used by views to check for updates.
Variable to be increased when updates are done to the editor, to allow easy check if redraw is needed.
Variable to be increased when updates are done to the editor, to allow easy check if redraw is needed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close