Comments (6)
@sherubthakur - thanks for the detailed design!
So it seems like the way this would work would be kind of "pluggable" logic that where some part of the Engine as we have it today lives in a separate part of the code. We did a little of this in the last stream with ViEngine, but this sounds like a deeper change that would also move the emacs logic into its own engine as well.
If I understand correctly, they would still use a similar EditCommand, though maybe that is something that's also changed a bit?
Something related is that I think you mention is that other parts of the engine should also be pluggable. @fdncred mentioned to me the other day how we should make sure to make completions pluggable, so that we could design new completion popups and widgets without having to change a bunch of the code in reedline. This makes sense, and is another good area we could make more generic with clever use of traits.
I'd say if it sounds like I understand the gist of what you're suggesting, let's go for it!
from reedline.
Some things I will just throw around to think about:
- How much of the text editing actions should be implemented on
LineBuffer
or implemented in your proposedEditEngine
. If this would become too much of a thin wrapper, we might want to collapse reasonable parts. - Thinking about the vi mode we probably want to be able to express most of the actions as building blocks for selecting a span and then executing either just a cursor move, cutting/copying, a replacement, or some special function for upper-casing etc. This would also be great for programmatic interfaces when doing completions or running expansions on snippets, paths or in editor shell expansion.
- When we display hints or completions inline should this be part of the line buffer, do we want to maintain a separate list of all available or displayed hints (think type hints, completion on the current typed token, history based hint for the whole line) in the EditEngine
- We may want to maintain the core command line buffer while having separate editing functionality on search strings (in the reverse/forward search mode) and aborting a search may preserve the previous line edit.
- Having nice modal dialogs for reverse search and also completions should play seamlessly with the keybinding actions (challenge can be seen with #60) so the line editor should be able to switch modes that then affect the chosen actions and the repaint logic.
from reedline.
@jonathandturner I tried to codify my very high level thoughts here about plugable
type things and document an over-arching theme about what would make a line-editor great. It's higher level than this and higher level than your TODO.txt
but I wonder how many of them the reedline
community agrees with and would like to see.
from reedline.
How much of the text editing actions should be implemented on LineBuffer or implemented in your proposed EditEngine. If this would become too much of a thin wrapper, we might want to collapse reasonable parts.
When I pulled this abstraction out, a lot of what it was doing is something that the line-buffer should do (IMO). The way I have structured it currently, it has more than a few responsibilities which I don't like.
from reedline.
The following PRs together achieved this --
- Extracting operations on buffer into line buffer
- Extracting Paint operations out of main buffer
- Unification of History operations
- Extraction of core editing functionality
- Extraction to core editor - undo/redo
- Extraction to core editor - up/down
- Extraction of EditMode
There are some other PRs that help with some minor fixes. These are the major ones that help in achieving the vision outlined in this issue.
I think we can close this issue.
from reedline.
And.... Done
from reedline.
Related Issues (20)
- `Move(Big)WordRightEnd` is off-by-1 in insert mode HOT 1
- New actions to cancel menu & accept-and-hold
- Index out of bounds HOT 8
- 0.30.0 (Nu 0.91.0) does not respect cursor position after host cmd exec in a keybinding HOT 10
- Prefix history search broken in vi-mode HOT 5
- `columnar_menu` panics on non-ASCII characters in directory
- Mouse controls HOT 1
- vi keybinds are wrong and/or inconsistent with readline HOT 2
- Modal Menus
- Default keybind for "newline" HOT 1
- Column menu spaces don't respect special characters (accents, emojis...)
- Cursor slowdown when pressing left/right arrows and there is a lot of text in the prompt HOT 2
- analog to inputrc for programs using reedline HOT 1
- progress in recommended phrase by one word-bound HOT 1
- Problem with powershell HOT 2
- `oh-my-posh` left and right prompt are not drawn at the same level HOT 3
- Panic in IdeMenu::create_value_string HOT 1
- Command history additional alternative to sync_on_enter HOT 3
- Highlight arbitrary matches HOT 3
- Nushell: Multi-line Prompt Bug When Resizing Window HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reedline.