feat(core): Add input modes and half-page cursor movement.
Some checks failed
CI / Check (macos-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Clippy (strict) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Some checks failed
CI / Check (macos-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Clippy (strict) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -275,7 +275,12 @@ fn gen_nav_actions(actions: &[ActionExpr]) -> syn::Result<Vec<TokenStream>> {
|
||||
let method = Ident::new(&name.replace('-', "_"), Span::call_site());
|
||||
let needs_count = matches!(
|
||||
name.as_str(),
|
||||
"move-up" | "move-down" | "page-up" | "page-down"
|
||||
"move-up"
|
||||
| "move-down"
|
||||
| "page-up"
|
||||
| "page-down"
|
||||
| "half-page-up"
|
||||
| "half-page-down"
|
||||
);
|
||||
if needs_count {
|
||||
calls.push(quote! { v.#method(1); });
|
||||
@@ -418,6 +423,10 @@ fn menu_action_variant(name: &str) -> syn::Result<TokenStream> {
|
||||
"move-to-bottom" => quote! { Action::MoveToBottom },
|
||||
"page-up" => quote! { Action::PageUp(1) },
|
||||
"page-down" => quote! { Action::PageDown(1) },
|
||||
"half-page-up" => quote! { Action::HalfPageUp(1) },
|
||||
"half-page-down" => quote! { Action::HalfPageDown(1) },
|
||||
"set-mode-insert" => quote! { Action::SetMode(pikl_core::event::Mode::Insert) },
|
||||
"set-mode-normal" => quote! { Action::SetMode(pikl_core::event::Mode::Normal) },
|
||||
_ => {
|
||||
return Err(syn::Error::new(
|
||||
Span::call_site(),
|
||||
|
||||
Reference in New Issue
Block a user