Insert
|
Insert |
constructor(row, line)
|
Insert.constructor |
should create a new Insert object
|
- |
#row
|
Insert#row |
should get the row index of the command
|
- |
should be read-only
|
- |
#line
|
Insert#line |
should get the line to be inserted by the command
|
- |
should be read-only
|
- |
Delete
|
Delete |
constructor(row)
|
Delete.constructor |
should create a new Delete object
|
- |
#row
|
Delete#row |
should get the row index of the command
|
- |
should be read-only
|
- |
_applyCommand(textEditor, command, rowOffset)
|
_applyCommand |
should apply the command to the text editor
|
- |
applyEditScript(textEditor, script, rowOffset)
|
applyEditScript |
should apply the commands in the script sequentially to the text editor
|
- |
shortestEditScript(from, to, limit = -1)
|
shortestEditScript |
should compute the shortest edit script between two arrays of strings
|
- |
Focus
|
Focus |
constructor(row, column, offset)
|
Focus.constructor |
should create a new Focus object
|
- |
#row
|
Focus#row |
should get the row of the focused cell
|
- |
should be read-only
|
- |
#column
|
Focus#column |
should get the column of the focused cell
|
- |
should be read-only
|
- |
#offset
|
Focus#offset |
should get the raw offset
|
- |
should be read-only
|
- |
#posEquals(focus)
|
Focus#posEquals |
should return true if two focuses point the same cell
|
- |
#setRow(row)
|
Focus#setRow |
should create a copy of the focus object by setting its row to the specified value
|
- |
#setColumn(row)
|
Focus#setColumn |
should create a copy of the focus object by setting its column to the specified value
|
- |
#setOffset(row)
|
Focus#setOffset |
should create a copy of the focus object by setting its offset to the specified value
|
- |
_delimiterText(alignment, width)
|
_delimiterText |
should return a delimiter text for the specified alignment
|
- |
should throw an error if the alignment is unknown
|
- |
_extendArray(arr, size, callback)
|
_extendArray |
should create a new array that is extended to the specified size, filling empty elements by return values of the callback
|
- |
completeTable(table, options)
|
completeTable |
should complete the given table by adding missing delimiter and cells
|
- |
should throw an error if table has no rows
|
- |
_computeTextWidth(text, options)
|
_computeTextWidth |
should compute the width of a text based on EAW properties
|
- |
_alignText(text, width, alignment, options)
|
_alignText |
should align the text
|
- |
should throw an error if the alignment is unknown
|
- |
should throw an error if default alignment is specified
|
- |
_padText(text)
|
_padText |
should add one space paddings to both sides of the text
|
- |
_formatTable(table, options)
|
_formatTable |
should format a table
|
- |
_weakFormatTable(table, options)
|
_weakFormatTable |
should format a table weakly
|
- |
formatTable(table, options)
|
formatTable |
should format a table, normally or weakly
|
- |
should throw an error if an unknown format type is specified
|
- |
alterAlignment(table, columnIndex, alignment, options)
|
alterAlignment |
should alter a column's alignment at the index to the specified alignment
|
- |
should return the original table if alternation can not be done
|
- |
insertRow(table, rowIndex, row)
|
insertRow |
should insert the row at the specified index and return a new table
|
- |
deleteRow(table, rowIndex)
|
deleteRow |
should delete a row at the specified index and return a new table object
|
- |
moveRow(table, rowIndex, destIndex)
|
moveRow |
should move a row at the index to the specified destination
|
- |
insertColumn(table, columnIndex, column, options)
|
insertColumn |
should insert a column at the specified index
|
- |
deleteColumn(table, columnIndex)
|
deleteColumn |
should delete a column at the specified index
|
- |
moveColumn(table, columnIndex, destIndex)
|
moveColumn |
should move a column at the index to the specified destination
|
- |
_value(obj, key, defaultVal)
|
_value |
should read a value from the object or use the default value if not exists
|
- |
should return the default value if obj is not an object
|
- |
_values(obj, keys)
|
_values |
should read multiple values from the object or use the default values if not exist
|
- |
should use the default values if obj is not an object
|
- |
options(obj)
|
options |
should read options from the object and return an object that contains complete options
|
- |
_splitCells(text)
|
_splitCells |
should split a text into cells
|
- |
_readRow(text, leftMarginRegex = /^\s*$/)
|
_readRow |
should read a table row
|
- |
marginRegexSrc(chars)
|
marginRegexSrc |
should create a regex source string of margin character class
|
- |
should ignore a pipe, a backslash, and a backquote in the argument
|
- |
_marginRegex(chars)
|
_marginRegex |
should create a regular expression object that matches whitespaces or specified characters
|
- |
should ignore a pipe, a backslash, and a backquote in the argument
|
- |
readTable(lines, options)
|
readTable |
should read a table from an array of texts, each text represents a row
|
- |
Point
|
Point |
constructor(row, column)
|
Point.constructor |
should create a new Point object
|
- |
#row
|
Point#row |
should get the row of the point
|
- |
should be read-only
|
- |
#column
|
Point#column |
should get the column of the point
|
- |
should be read-only
|
- |
#equals(point)
|
Point#equals |
should return true if two points are equal
|
- |
Range
|
Range |
constructor(start, end)
|
Range.constructor |
should create a new Range object
|
- |
#start
|
Range#start |
should get the start point of the range
|
- |
should be read-only
|
- |
#end
|
Range#end |
should get the end point of the range
|
- |
should be read-only
|
- |
TableCell
|
TableCell |
constructor(rawContent)
|
TableCell.constructor |
should create a new TableCell object
|
- |
#rawContent
|
TableCell#rawContent |
should get the raw content of the cell
|
- |
should be read-only
|
- |
#content
|
TableCell#content |
should get the trimmed content of the cell
|
- |
should be read-only
|
- |
#paddingLeft
|
TableCell#paddingLeft |
should get the width of the left padding of the cell
|
- |
#paddingRight
|
TableCell#paddingRight |
should get the width of the right padding of the cell
|
- |
#toText()
|
TableCell#toText |
should return the raw content of the cell
|
- |
#isDelimiter()
|
TableCell#isDelimiter |
should return true if it only contains hyphens with optional one leading and trailing colons
|
- |
#getAlignment()
|
TableCell#getAlignment |
should return the alignment that the cell represents
|
- |
should return undefined if the cell is not a delimiter
|
- |
#computeContentOffset(rawOffset)
|
TableCell#computeContentOffset |
should compute a relative position in the trimmed content from that in the raw content
|
- |
#computeRawOffset(contentOffset)
|
TableCell#computeRawOffset |
should compute a relative position in the raw content from that in the trimmed content
|
- |
_createIsTableRowRegex(leftMarginChars)
|
_createIsTableRowRegex |
should return a regular expression object that matches a table row
|
- |
should ignore a pipe, a backslash, and a backquote
|
- |
_computeNewOffset(focus, completed, formatted, moved)
|
_computeNewOffset |
should compute new focus offset from the information of the completed and formatted tables
|
- |
TableEditor
|
TableEditor |
constructor(textEditor)
|
TableEditor.constructor |
should create a new TableEditor object
|
- |
#resetSmartCursor()
|
TableEditor#resetSmartCursor |
should reset the smart cursor flag
|
- |
#cursorIsInTable(options)
|
TableEditor#cursorIsInTable |
should return true if the cursor of the text editor is in a table
|
- |
#_findTable(options)
|
TableEditor#_findTable |
should find a table under the current cursor position and return an object that describes the table
|
- |
should return undefined if there is no table at the cursor position
|
- |
#_withTable(options, func)
|
TableEditor#_withTable |
should call the function with table information obtained by _findTable() method
|
- |
should not call the function if no table is found
|
- |
#_updateLines(startRow, endRow, newLines, oldLines = undefined)
|
TableEditor#_updateLines |
should update lines in the specified range
|
- |
#_moveToFocus(startRow, table, focus)
|
TableEditor#_moveToFocus |
should move the cursor position to the focused cell
|
- |
should do nothing if the focused row is out of the table
|
- |
#_selectFocus(startRow, table, focus)
|
TableEditor#_selectFocus |
should select the focued cell in the text editor if the cell is not empty
|
- |
should move the cursor position if the cell is empty
|
- |
should do nothing if the focused row is out of the table
|
- |
format(options)
|
TableEditor#format |
should format the table under the cursor
|
- |
#escape(options)
|
TableEditor#escape |
should format and escape from the table
|
- |
#alignColumn(alignment, options)
|
TableEditor#alignColumn |
should alter alignment of a column
|
- |
#selectCell(options)
|
TableEditor#selectCell |
should select the focused cell content
|
- |
#moveFocus(rowOffset, columnOffset, options)
|
TableEditor#moveFocus |
should move focus by the offsets
|
- |
#nextCell(options)
|
TableEditor#nextCell |
should move the focus to the next cell
|
- |
should treat smart cursor correctly
|
- |
#previousCell(options)
|
TableEditor#previousCell |
should move the focus to the previous cell
|
- |
#nextRow(options)
|
TableEditor#nextRow |
should move the focus to the next row
|
- |
should treat smart cursor correctly
|
- |
#insertRow(options)
|
TableEditor#insertRow |
should insert an empty row at the focus
|
- |
#deleteRow(options)
|
TableEditor#deleteRow |
should delete a row at the focus
|
- |
#moveRow(offset, options)
|
TableEditor#moveRow |
should move the focused row by the specified offset
|
- |
#insertColumn(options)
|
TableEditor#insertColumn |
should insert an empty column at the focus
|
- |
#deleteColumn(options)
|
TableEditor#deleteColumn |
should delete a column at the current focus
|
- |
#moveColumn(offset, options)
|
TableEditor#moveColumn |
should move the focused column by the specified offset
|
- |
#formatAll(options)
|
TableEditor#formatAll |
should format all the tables in the text editor
|
- |
TableRow
|
TableRow |
constructor(cells, marginLeft, marginRight)
|
TableRow.constructor |
should create a new TableRow object
|
- |
#marginLeft
|
TableRow#marginLeft |
should get the margin string at the left
|
- |
should be read-only
|
- |
#marginRight
|
TableRow#marginRight |
should get the margin string at the right
|
- |
should be read-only
|
- |
#getWidth()
|
TableRow#getWidth |
should get the number of the cells
|
- |
#getCells()
|
TableRow#getCells |
should return an array of cells that the row contains
|
- |
#getCellAt(index)
|
TableRow#getCellAt |
should return the cell at the index if exists
|
- |
should return undefined if no cell is found
|
- |
#toText()
|
TableRow#toText |
should return a text representation of the row
|
- |
#isDelimiter
|
TableRow#isDelimiter |
should return true if the row is a delimiter
|
- |
Table
|
Table |
constructor(rows)
|
Table.constructor |
should create a new Table object
|
- |
#getHeight()
|
Table#getHeight |
should return the number of the rows
|
- |
#getHeight()
|
Table#getHeight |
should return the number of the rows
|
- |
#getWidth()
|
Table#getWidth |
should return the maximum number of the columns of the rows
|
- |
#getHeaderWidth()
|
Table#getHeaderWidth |
should return the number of the columns of the header rows
|
- |
should return undefined if there is no header row
|
- |
#getRows()
|
Table#getRows |
should return an array of the rows that the table contains
|
- |
#getRowAt(index)
|
Table#getRowAt |
should return the row at the specified index
|
- |
should return undefined if no row is found
|
- |
#getDelimiterRow()
|
Table#getDelimiterRow |
should return the delimiter row of the table
|
- |
should return undefined if there is no delimiter row
|
- |
#getCellAt(rowIndex, columnIndex)
|
Table#getCellAt |
should return the cell at the specified index
|
- |
should return undefined if no cell is found
|
- |
#getFocusedCell(focus)
|
Table#getFocusedCell |
should get the cell at the focus
|
- |
should return undefined if no cell is found
|
- |
#toLines()
|
Table#toLines |
should return an array of text representations of the rows
|
- |
#focusOfPosition(pos, rowOffset)
|
Table#focusOfPosition |
should compute a focus from a point in the text editor
|
- |
should return undefined if the row index is out of bounds
|
- |
#positionOfFocus(focus, rowOffset)
|
Table#positionOfFocus |
should compute a position from a focus
|
- |
should return undefined if the focused row is out of the table
|
- |
#selectionRangeOfFocus(focus, rowOffset)
|
Table#selectionRangeOfFocus |
should compute a selection range from a focus
|
- |
should return undefined if the focus does not specify any cell
|
- |
should return undefined if the specified cell is empty
|
- |
ITextEditor
|
ITextEditor |
#getCursorPosition()
|
ITextEditor#getCursorPosition |
should be not implemented, throw an error
|
- |
#setCursorPosition(pos)
|
ITextEditor#setCursorPosition |
should be not implemented, throw an error
|
- |
#setSelectionRange()
|
ITextEditor#setSelectionRange |
should be not implemented, throw an error
|
- |
#getLastRow()
|
ITextEditor#getLastRow |
should be not implemented, throw an error
|
- |
#acceptsTableEdit()
|
ITextEditor#acceptsTableEdit |
should be not implemented, throw an error
|
- |
#getLine()
|
ITextEditor#getLine |
should be not implemented, throw an error
|
- |
#insertLine()
|
ITextEditor#insertLine |
should be not implemented, throw an error
|
- |
#deleteLine()
|
ITextEditor#deleteLine |
should be not implemented, throw an error
|
- |
#replaceLines()
|
ITextEditor#replaceLines |
should be not implemented, throw an error
|
- |
#transact()
|
ITextEditor#transact |
should be not implemented, throw an error
|
- |