Simple Text Editor

This program implements a basic text editing protocol in which the following commands can be executed:

Note: The protocol specifies that the first line of the input read by the program is interpreted as the number of commands that follow.

Usage

To test this, build the code using the cargo toolchain, invoking the Rust compiler. To install cargo and Rust, see: https://www.rust-lang.org/tools/install

sh $ cargo build --bin editor

Then, use the provided test input file input.txt, or create your own.

sh $ cat input.txt | ./target/debug/editor

This should print both the characters (one per line, per "print" command, e.g. 3) as well as the final buffer after all commands have exectuted.

Contributions

This is just for fun! However, as someone who is always trying to improve their programming skills, I would be grateful to know where optimizations could be made. PRs are welcome. Or if a bug is encountered, file an issue and I'll take a look!