feat(input): Ctrl+scroll changes font size#77
Open
roramirez wants to merge 1 commit into
Open
Conversation
Holding Ctrl while scrolling the mouse wheel now zooms the active pane's font size (up = bigger, down = smaller) via the existing change_font_size helper, taking priority over mouse reporting and viewport scrolling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Holding Ctrl while scrolling the mouse wheel now changes the active pane's font size (scroll up = bigger, scroll down = smaller) instead of scrolling the viewport. This matches common terminal zoom behavior and reuses the existing font-size machinery.
Changes
src/app_event.rs:handle_mouse_wheelnow checksself.modifiers.state().control_key()first; when Ctrl is held it calls the existingchange_font_sizehelper (+1/-1) and returns, taking priority over both the mouse-reporting (>=1000) path and viewport scrolling.src/main_test.rs: added tests that Ctrl+wheel-up increases and Ctrl+wheel-down decreases the active pane's font size, and that a wheel event without Ctrl leaves the font size unchanged.CHANGELOG.md,README.md,doc/SPEC.md: documented the new Ctrl+scroll shortcut alongside the existing font-size shortcuts.How to test
cargo test— the two new tests insrc/main.rs(ctrl_wheel_up_increases_font_and_down_decreases,wheel_without_ctrl_leaves_font_untouched) pass.