Methods
(static) disableRawMode() → {void}
clear TTY rowmode
Returns:
- Type
- void
(static) editorRowCxToRx(row, cx) → {int}
- - treat \t
- - treat unicode multibyte characters
Parameters:
Name | Type | Description |
---|---|---|
row |
string | target row |
cx |
int | target cx |
Returns:
rx - rx position
- Type
- int
(static) editorUpdateSyntax(row) → {string}
syntax highlighting
Parameters:
Name | Type | Description |
---|---|---|
row |
string | one row |
Returns:
- highlighted string
- Type
- string
(static) enableRawMode() → {void}
set TTY rowmode
Returns:
- Type
- void
die(e, status) → {void}
exit if some error happened
Parameters:
Name | Type | Description |
---|---|---|
e |
string | dying message |
status |
int | exit status default: 1 |
Returns:
- Type
- void
editorDelChar() → {void}
delete single char
Returns:
- Type
- void
editorDrawMessageBar() → {void}
drow message bar
Returns:
- Type
- void
editorDrawRows() → {void}
drow file contents
Returns:
- Type
- void
editorDrawStatusBar() → {void}
drow status bar
Returns:
- Type
- void
editorInsertChar(c) → {void}
insert single char
Parameters:
Name | Type | Description |
---|---|---|
c |
char | char which will be inserted |
Returns:
- Type
- void
editorInsertRow(insert) → {void}
insert one row
Parameters:
Name | Type | Description |
---|---|---|
insert |
string | string which will be inserted |
Returns:
- Type
- void
editorMoveCursor(name, sequence) → {void}
handle key action for cursor movement
Parameters:
Name | Type | Description |
---|---|---|
name |
string | key.name |
sequence |
string | key.sequence |
Returns:
- Type
- void
editorOpen() → {void}
- set erow // editor low
- set render // for rendering low
Throws:
-
- ENOENT: no such file or directory, open this.filename
- Type
- Error
Returns:
- Type
- void
editorReadKey(str, key) → {void}
handle key action
Parameters:
Name | Type | Description |
---|---|---|
str |
string | captured str (not used in this class) |
key |
Object | captured key information |
Throws:
Error
Returns:
- Type
- void
editorRefreshScreen() → {void}
- hide cursor
- draw rows (file contents)
- draw status bar
- draw message bar
- set cursor proper position (rx,cy)
- show cursor
Returns:
- Type
- void
editorResize() → {void}
resize terminal
Returns:
- Type
- void
editorSave() → {void}
save to this.E.filename
Returns:
- Type
- void
editorScroll() → {void}
- handle rowoff
- handle coloff
Returns:
- Type
- void
editorSetStatusMessage(message) → {void}
show status message in 5 secs
Parameters:
Name | Type | Description |
---|---|---|
message |
string | status message |
Returns:
- Type
- void
editorUpdateRow() → {void}
update render
Returns:
- Type
- void
main() → {void}
main function
Returns:
- Type
- void