Repository navigation
Added font zoom (Alt+Scroll / Ctrl+0) for Terminal and Markdown Preview - #120
Merged
Merged
Conversation
The Zoom submenu was previously registered via JComponent.setComponentPopupMenu(). JediTerm's TerminalPanel builds its right-click menu internally (its own mouse listener calls the protected createPopupMenu() and fills it from the TerminalActionProvider chain) and never consults Swing's component popup, so the Zoom item appeared as a separate single-item menu instead of extending the native Copy/Paste/Clear menu. Added ZoomableJediTermWidget, a JediTermWidget subclass whose overridden createTerminalPanel() returns a TerminalPanel that overrides createPopupMenu(): it builds the native menu via super, then appends a separator and the Zoom submenu. The append logic is extracted into the unit-tested ZoomSupport.appendZoomMenu(JPopupMenu, Zoomable). The same subclass exposes refreshFont(), replacing the reflective TerminalPanel.reinitFontAndResize() call in ClaudeSessionTab.applyTermZoom(). Documented in CLAUDE.md why JediTerm is used instead of NetBeans' built-in terminal (no alt-screen buffer / 256-color, no screen-buffer introspection, non-extensible context menu, no per-instance zoom, friend-only API). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adding any MouseWheelListener to the JEditorPane disabled Swing's native dispatchMouseWheelToAncestor fallback (gated by eventTypeEnabled(MOUSE_WHEEL)), so plain wheel events no longer reached the wrapping JScrollPane. The zoom listener only handled Alt+wheel and dropped the rest. Added a createWheelListener(Zoomable, boolean forwardToScrollAncestor) overload that re-dispatches non-zoom wheel events to the nearest ancestor JScrollPane, replicating the JDK's behavior. Markdown Preview opts in (both openLive and componentOpened paths); the legacy single-arg method delegates with false so JediTerm's terminal panel — which scrolls via its own wheel listener — is unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ctrl+0 (reset zoom) and F5 (refresh from disk) were registered only in the JEditorPane's WHEN_IN_FOCUSED_WINDOW input map, which the NetBeans global keymap pre-empts. Mirroring the earlier Ctrl+F fix, both keystrokes are now also bound in WHEN_FOCUSED so they win while the preview pane is focused. ZoomSupport.bindResetKey is shared with the terminal, but the change is inert there (the TopComponent is never the focus owner and Ctrl+0 is handled via a KeyEventDispatcher). Added unit tests for both bindings and a CHANGELOG entry for the F5 regression (Ctrl+0 is part of the still-unreleased zoom feature). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Adds a per-surface font zoom feature for both the embedded terminal and the Markdown Preview.
Features
setComponentPopupMenu).NbPreferences.Fixes included on this branch
JEditorPanedisabled the JDK'sdispatchMouseWheelToAncestorfallback; non-zoom wheel events are now forwarded to the ancestorJScrollPane).WHEN_IN_FOCUSED_WINDOW, which the NetBeans global keymap pre-empts. They are now also bound inWHEN_FOCUSED(mirroring the existing Ctrl+F fix), so they win while the preview pane is focused.CHANGELOG
(Ctrl+0/F5 input-map fixes carry no separate CHANGELOG entry where the surrounding zoom feature is still unreleased; the F5 regression entry is included because Refresh shipped in a published release.)
Tests
ZoomSupportTest,MarkdownZoomTest,NetBeansSettingsProviderZoomTestcover the wheel listener, scroll-forwarding regression, zoom menu, and the Ctrl+0 / F5 input-map bindings.mvn package→ 808 tests, 0 failures, 0 errors.Manual verification (confirmed)
🤖 Generated with Claude Code