Skip to content

feat: scrolling down with Enter and up with alt+enter - #316

Open
abhijeet-singh800 wants to merge 1 commit into
RivoLink:mainfrom
abhijeet-singh800:feat-scroll-using-enter
Open

abhijeet-singh800 wants to merge 1 commit into
RivoLink:mainfrom
abhijeet-singh800:feat-scroll-using-enter

Conversation

@abhijeet-singh800

Copy link
Copy Markdown

Fixes #255

This PR adds a scroll-with-enter config option. When it's true, Enter scrolls the preview down one line and Alt+Enter scrolls it up one line (Default ; false). Preference given to the search when active.

Behavior Table

scroll-with-enter Key State Result
off Enter / Alt+Enter preview no change
off Enter / Alt+Enter active search next match (unchanged)
on Enter preview scroll down 1
on Alt+Enter preview scroll up 1
on Enter / Alt+Enter active search next match
on Enter after Esc preview scroll down 1
any Enter / Alt+Enter code-select copy block (unchanged)
any Enter search input confirm query (unchanged)
  • The new arms sit directly below the existing Enter if has_active_search() arm in keyboard.rs. The Alt arm comes before the bare Enter arm, otherwise Alt+Enter would scroll down.
  • Code-select mode is unchanged: Enter still copies the block.
  • Config only, no LEAF_* env var, same as watch and hyper-link-prefix.
  • Strict bool, same as watch: an invalid value like "yes" falls back to defaults, as it already does for the other bool keys.
  • Some terminals capture Alt+Enter (Windows Terminal toggles fullscreen), and macOS terminals need "Use Option as Meta". This is documented in config.toml. k / ↑ still work everywhere.

Testing

  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings, cargo build --release.
  • Binary Test by Hand for Scroll Down with Enter and Scroll Up with Alt + Enter

Head Up : I built it with the help of AI and reviewed the changes and tested it by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request : Use Enter to scroll down

1 participant