Skip to content

Added Find bar (Ctrl+F / F3 / Shift+F3) to Markdown Preview - #119

Merged
oleg68 merged 2 commits into
nbplugins:mainfrom
oleg68:feature/markdown-find-bar
May 17, 2026
Merged

oleg68 merged 2 commits into
nbplugins:mainfrom
oleg68:feature/markdown-find-bar

Conversation

@oleg68

@oleg68 oleg68 commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added MarkdownFindBar in package io.github.nbclaudecodegui.ui.common.markdown — custom find bar mirroring NetBeans SearchBar layout and icons (loaded from editor.search module JAR at runtime, no copying)
  • Wired into MarkdownPreviewTab (single-pane preview) and MarkdownDiffPanel (independent bar per pane)
  • Ctrl+F / right-click "Find…" opens bar; F3 = next, Shift+F3 = prev, Escape = close
  • Supports: match case, whole words, regexp, highlight all, wrap around
  • Search history persisted to NbPreferences and restored on IDE restart
  • F3 when bar is closed: searches immediately and navigates in one keypress
  • Repeated F3 advances past current match using selectionEnd as boundary

Test plan

  • Open markdown preview → Ctrl+F → find bar appears at bottom with icons + labels
  • Type query → incremental search, match counter shown
  • F3 / Shift+F3 navigate next/prev; wrap around works
  • Toggle Aa / W / .* / H / ↩ buttons
  • Close with Escape or ×, reopen with F3 — resumes from correct position
  • Combo dropdown shows history; history survives IDE restart
  • Diff pane (MarkdownDiffPanel) — each pane has its own independent find bar

🤖 Generated with Claude Code

Oleg Samarin and others added 2 commits May 17, 2026 16:56
Find bar mirrors NetBeans SearchBar layout and uses its icons loaded
from the editor.search module JAR via ImageUtilities. Supports
incremental search, match case, whole words, regexp, highlight all,
wrap around. Added to MarkdownPreviewTab (single-pane preview) and
MarkdownDiffPanel (per-pane, independent bars).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…avigation

- Combo sized dynamically 200–350 px (mirrors SearchComboBox)
- Previous/Next/Select buttons show icon + text label (matches NB SearchBar)
- Search history persisted to NbPreferences and restored on IDE restart
- Ctrl+F bound on WHEN_FOCUSED to override built-in JEditorPane action
- F3/Shift+F3 bound directly on find bar text field (WHEN_FOCUSED)
- F3 when bar is closed: searches and navigates in one keypress (no double-press)
- Repeated F3 advances past current match using selectionEnd as boundary
- looseFocus() preserves matchPositions so F3 resumes from correct position

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit b8142ab into nbplugins:main May 17, 2026
3 checks passed
@oleg68
oleg68 deleted the feature/markdown-find-bar branch May 17, 2026 17:37
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.

1 participant