liq.buffer | liq.commands | liq.editor

liq.buffer/append-line-at-end
([buf n] [buf])
  Append empty lines at end


liq.buffer/beginning-of-buffer
([buf n] [buf])
  Move cursor to the beginning of the buffer


liq.buffer/beginning-of-line
([buf])
  Move cursor to beginning of current line


liq.buffer/buffer
([text {:keys [name filename top left rows cols major-mode major-modes mode], :as options}] [text])
  Create a buffer map.
  Input: Various fields
  Output: Buffer
  Side effects: None


liq.buffer/col-count
([buf row])
  Number of columns on a given line in a buffer.


liq.buffer/delete-to-line-end
([buf])
  Delete content form the cursor to the end of the line.


liq.buffer/dirty?
([buf])
  Return true if the buffer is changed since last save.


liq.buffer/down
([buf n] [buf])
  Move cursor down.
  If n is specified move down n steps.


liq.buffer/end-of-buffer
([buf])
  Move cursor to the end of the buffer


liq.buffer/end-of-line
([buf])
  Move cursor to end of current line


liq.buffer/end-point
([buf])
  The last point in the buffer


liq.buffer/expand-selection
([buf r])
  Expand a selection with a region


liq.buffer/get-char
([buf row col] [buf p] [buf])
  Get the character symbol at a given position.


liq.buffer/get-selection
([buf])
  Return the selection point.
  One can also use
  (buf ::buffer/selection)
  directly.


liq.buffer/insert-in-vector
([v n elem])
  Insert an element into a vector, at a given position.
  (insert-in-vector [:a :c :d] 1 :b) -> [:a :b :c :d])
  If not 0 <= n <= length an exception will be thrown.
  Input: Vector, position, element
  Output: Vector
  Side effects: None


liq.buffer/left
([buf n] [buf])
  Move cursor backward.
  If n is specifed backward n steps.


liq.buffer/line
([buf row] [buf row col] [buf])
  Get line as string


liq.buffer/line-count
([buf])
  Number of lines in the buffer.


liq.buffer/line-region
([buf p] [buf])
  Line at point as region.


liq.buffer/match-at-pos
([s pos re])
  Match regular expression at position 0 based.
  Returns substring or nil


liq.buffer/paren-match-after
([buf p0 paren])
  (abc (def) hi|jk)


liq.buffer/paren-match-before
([buf p0 paren])
  (abc (def) hi|jk)


liq.buffer/paren-matching-region
([buf p])
  Forward until first paren on given row.
  Depending on type and direction move to corresponding
  paren.
  Returns nil if there is no hit.


liq.buffer/point-compare
([p1 p2])
  Compares two point p1 and p2.
  If p1 is before p2 -1 is returned.
  If p1 is after p2 1 is returned.
  If p1=p2 0 is returned.


liq.buffer/previous-point
([buf p] [buf])
  If only a buffer is supplied the point will be set
  on the buffer, otherwise:
  The previous point will be returned or nil, if the
  input is the first point


liq.buffer/recalculate-tow
([buf rows cols tow1])
  This is a first draft, which does not handle edge
  cases with very long lines and positioning logic.


liq.buffer/remove-selection
([buf])
  Set selection point to nil.


liq.buffer/right
([buf n] [buf])
  Move cursor forward.
  If n is specifed forward n steps.


liq.buffer/search
([buf w] [buf])
  


liq.buffer/set-dirty
([buf val])
  Set the buffer as dirty.
  Should be called when a change has been made which is
  not saved yet.


liq.buffer/set-insert-mode
([buf])
  Set mode to :insert and set selection point to nil.


liq.buffer/set-normal-mode
([buf])
  Set mode to :normal and set selection point to nil.


liq.buffer/set-selection
([buf p] [buf row col] [buf])
  Set the selection point. If no point is given,
  the current cursor position will be used.


liq.buffer/set-undo-point
([buf])
  Return new lines with the current lines to the undo stack.
  Input: Buffer
  Output: Buffer
  Side effects: None


liq.buffer/set-visual-mode
([buf])
  Set mode to :visual and set selection point.


liq.buffer/shrink-region
([buf r])
  Narrow in the given region in both ends


liq.buffer/sub-buffer
([buf row1 row2])
  Buffer with row1 as first row and row2 as last.
  Cursor translated accordingly.


liq.buffer/text
([buf] [buf p1 p2] [buf r])
  Get the text ind the buffer.
  If a region or two points is specified the text will be the
  contained text.


liq.buffer/thing-at-point
([buf re])
  Return regex match around point.
  If no match nil is returned


liq.buffer/undo
([buf])
  Returns the first buffer in the undo stack.


liq.buffer/up
([buf n] [buf])
  Move cursor up.
  If n is specified move up n steps.


liq.buffer/word
([buf row col] [buf p] [buf])
  Get word at a given point point.


liq.buffer/word-beginnings
([text])
  TODO Not used