`radicle-term` includes quite a lot of rather "low-level" logic to spawn the preferred editor of the user. In particular, this logic is platform-dependent and only works on Unix-like platforms. Also, `radicle-term` already depends on `inquire` which features an editor prompt. It is a cross-platform solution to spawn the editor. This commit changes the implementation of `Editor` to be a wrapper of `inquire::Editor`, keeping the interface mostly intact. Downsides: - We cannot edit a file "in place" this way, instead we have to read it, as `inquire` only supports editing temporary files. This can also be viewed as a benefit, as we lessen the risk of corruption of these files. - `inquire::Editor` contains borrows, so it is quite cumbersome to extend it with a custom mechanism for looking up the preferred editor. The lookup logic was kept, but needs to be invoked by the caller. In the future we might consider just using the logic provided by `inquire` or requesting a change to `inquire`. - The prompt is a bit strange. It does not show the current state of the output, see <https://github.com/mikaelmello/inquire/issues/280> and <https://github.com/mikaelmello/inquire/pull/271>. |
||
|---|---|---|
| .. | ||
| examples | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| build.rs | ||