A Rust implementation of the Kilo text editor tutorial: https://viewsourcecode.org/snaptoken/kilo/index.html
Go to file
2019-10-04 15:49:45 -04:00
src Gracefully handle opening an empty file 2019-10-04 15:49:45 -04:00
.gitignore Ugly progress commit 2019-08-22 14:25:18 -04:00
Cargo.lock Update version 2019-09-13 11:27:39 -04:00
Cargo.toml Update version 2019-09-13 11:27:39 -04:00
README.md Minor code cleanup 2019-09-19 16:45:48 -04:00

Oxidized Kilo

A reimplementation of the Kilo tutorial in Rust.

Implementation notes:

  • The editor prefix has been removed from all the editor methods. Since this implementation uses impls on a shared Editor struct, the prefix is redundant
  • Any C equivalent functionality based on memory allocating/deallocating, or other manual book-keeping is instead implemented in a more idiomatic Rust fashion.
  • Row structs are referenced by their index in the Editor struct, rather than as a direct reference in method calls. This generally simplifies dealing with the rules of Rust (borrow checker).
  • The prompt method of the editor can not take an arbitrary formatting string, due to Rust requiring a string literal for string formatting macros.

Additions / Changes

  • Reverse coloring for search results, so comment types can have different colors
  • Two separate vectors are used to define the two types of keywords, rather than the weird pipe suffix