Uses new Rust 2021
|0.9.0-alpha3||Jun 14, 2022|
|0.9.0-alpha2||May 27, 2022|
|0.8.0||Aug 3, 2021|
|0.7.7||Jun 10, 2021|
|0.5.1||May 19, 2021|
#21 in Text editors
302 downloads per month
Used in hired
Some time ago I decided to write an ED clone with syntax highlighting, (hired)[https://github.com/sidju/hired]. On my way to that I found that the macro commands ('g', 'v', 'G', 'V') pretty much require that you write an ED library for them. So I did, and here it is.
Currently it is based on both my experiences with hired and the hired repo specifically (a manual fork, so it has the whole history). This may well mean the API is ill suited for your use. If that is the case I'd be happy to make some changes to make it more general.
The original ED keeps track of the last line you interacted with and defaults to working on that for most commands. I felt this deserved expanding, so add-ed instead tracks the last span of lines you interacted with. My hope is that this is more intuitive. (To avoid unpleasantries such as partial saving some commands default to the whole buffer instead. Such as 'w', the save command.)
The library has been designed with clear traits to enable changing out most components easily. For example it should be somewhat easy to create a SSH+sed Buffer implementation for remote editing, or a GUI frontend implementing the UI trait.
Include and expose a simple in-memory buffer implementation
Add 'C' command. This modifies the UI trait.
This project has greatly benefited from regex. Not only in use of this incredible crate but also through some advice in less than fully thought out issues.