sapling
sapling copied to clipboard
A highly experimental vi-inspired editor where you edit code, not text.
Rewrite of Sapling's initial prototype. The main change is that ASTs are now stored as concrete trees (i.e. trees of formatted tokens) specified by dynamically loaded `Grammar`s. This means that,...
I saw there was an issue about Leap Technology #44. I admit I haven't read the whole discussion but I agree with @kneasle it seems just like `/` and `?`...
To make implementation easier, the different modes in Sapling are implemented as a state machine (technically a DFA). So each 'mode' should have a struct which implements [`editor::state::State`](https://github.com/kneasle/sapling/blob/master/src/editor/state.rs#L28) (like [`editor::normal_mode::State`](https://github.com/kneasle/sapling/blob/1c57e649bce8539b224e79e93d7464784148facd/src/editor/normal_mode.rs#L30))....
Ideally, we'd have `log::trace!` in every function, and `log::debug!` when debug output might be useful.
So, there are a few things I can do if I’m an AST node (e.g. a variable). I could edit the string that’s the current leaf, e.g. “Emacs -> emacs”....
https://mightyiam.medium.com/edit-code-as-code-e51ead8522b5
One editing operation that often comes up is wrapping a subtree in another node. An example that happened to me recently in Rust if changing `Type` to `Option` in several...
Sooner or later we need to figure out how to do string editing - e.g. `"foo"` in Json or `` in XML. I only have a rough idea now, but...
Suppose that the cursor is over a field in an object (cursor in ``): ```json { } ``` If we type `rt` at this point will result in the following...
Currently there is no good documentation for how `Path`s are used to traverse trees. This is fairly non-trivial and for the longevity of Sapling it would be good to document...