Comments (6)
ok, I guess the problem is that movetolineend
will never fail, same with movetolinestart
, so I'm guessing you'd never get to the last command in the until.
from reedline.
On both of your keybindings you're using until
. until
means "run these things in order until one works". I'm wondering if that's what you're meaning to do.
Here's how you might change the first one.
{
name: move_to_line_end_or_take_history_hint
modifier: control
keycode: char_e
mode: [emacs, vi_normal, vi_insert]
event: [
{send: historyhintcomplete}
{edit: movetolineend}
{send: openeditor}
]
}
You can do something similar with your other one too.
from reedline.
On both of your keybindings you're using
until
.until
means "run these things in order until one works". I'm wondering if that's what you're meaning to do.
I think this is indeed what I would like to do. Unless you can conditionally sequence commands in other ways.
In essence, inside until commands take precedence by their order. In my example that would translate, if there is a suggestion take it, otherwise movetolineend and if that fails as well, which should when you're at the end already, then you may open the editor.
Not sure what the proposed solution does exactly, I would assume executing the commands, one after the other, but I don't think I've ever seen that being done outside of an until. At least, that is the case in the default config.
from reedline.
ok, I guess the problem is that
movetolineend
will never fail, same withmovetolinestart
, so I'm guessing you'd never get to the last command in the until.
Yes, pretty much. I think its more reasonable for the other way around besides being more practical.
from reedline.
Yes our EditCommand
operations are all infallible at the moment so they will never say that they were not handled.
Here all roads lead to EventStatus::Handled
.
Lines 1148 to 1190 in b1344f6
To allow more until
shenanigans, we would need to make each of the edit operations explicit about their return status. Then you could reorder them more freely.
Moving this over to reedline as the changes would need to happen here.
from reedline.
I have two related issues open regarding until
too: #603 and #604.
If time suffice and no one taking, this is a one-strike issue after my #608 to pull it off.
from reedline.
Related Issues (20)
- After `ExecuteHostCommand` is handled, new prompt is rendered HOT 1
- When prompt starting row is 0, new prompt is rendered on each key type HOT 5
- external_printer does not print until I press some key
- Implicit copy to system clipboard doesn't obey law of least surprise and poses potential security hazard HOT 10
- Suggestion about is_valid function of LineBuffer struct HOT 1
- Tab keybind doesnt work with modifiers HOT 5
- [QUESTION]: can I disable the indicator HOT 2
- `Move(Big)WordRightEnd` is off-by-1 in insert mode HOT 1
- 0.30.0 (Nu 0.91.0) does not respect cursor position after host cmd exec in a keybinding HOT 10
- New actions to cancel menu & accept-and-hold
- Index out of bounds HOT 8
- 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
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.