Class: Kilo

Kilo()

This is Kilo class

Constructor

new Kilo()

Source:

Methods

(static) disableRawMode() → {void}

clear TTY rowmode
Source:
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
Source:
To Do:
  • handle multibyte properly
Returns:
rx - rx position
Type
int

(static) editorUpdateSyntax(row) → {string}

syntax highlighting
Parameters:
Name Type Description
row string one row
Source:
Returns:
- highlighted string
Type
string

(static) enableRawMode() → {void}

set TTY rowmode
Source:
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
Source:
Returns:
Type
void

editorDelChar() → {void}

delete single char
Source:
To Do:
  • handle multibyte properly
Returns:
Type
void

editorDrawMessageBar() → {void}

drow message bar
Source:
Returns:
Type
void

editorDrawRows() → {void}

drow file contents
Source:
Returns:
Type
void

editorDrawStatusBar() → {void}

drow status bar
Source:
Returns:
Type
void

editorInsertChar(c) → {void}

insert single char
Parameters:
Name Type Description
c char char which will be inserted
Source:
To Do:
  • handle multibyte properly
Returns:
Type
void

editorInsertRow(insert) → {void}

insert one row
Parameters:
Name Type Description
insert string string which will be inserted
Source:
To Do:
  • handle multibyte properly
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
Source:
Returns:
Type
void

editorOpen() → {void}

  • set erow // editor low
  • set render // for rendering low
Source:
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
Source:
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
Source:
Returns:
Type
void

editorResize() → {void}

resize terminal
Source:
Returns:
Type
void

editorSave() → {void}

save to this.E.filename
Source:
Returns:
Type
void

editorScroll() → {void}

  • handle rowoff
  • handle coloff
Source:
Returns:
Type
void

editorSetStatusMessage(message) → {void}

show status message in 5 secs
Parameters:
Name Type Description
message string status message
Source:
Returns:
Type
void

editorUpdateRow() → {void}

update render
Source:
To Do:
  • handle multibyte properly
Returns:
Type
void

main() → {void}

main function
Source:
Returns:
Type
void