Double-click byte selection not working in HexEditorV2
🐛 Bug Description
Double-clicking on a byte in HexEditorV2 should select all bytes with the same value, but the selection is not being applied correctly.
Expected Behavior
When double-clicking on a byte (e.g., value 0x41):
- All bytes in the visible region with the same value should be selected
SelectionStart should be set to the first match position
SelectionStop should be set to the last match position
- The selected bytes should be visually highlighted
Actual Behavior
- Double-click is detected (confirmed by debug logs)
SelectAllBytesWith() method is called
- But the selection is not visually applied or doesn't work as expected
Technical Details
Implementation:
- Feature implemented in commit
bbec374 - "Fix double-click select to use real selection"
- Auto-highlight feature works correctly (commit
dbd0522)
- Uses real selection (SelectionStart/SelectionStop) instead of visual highlighting
Key Files:
V2/HexEditorV2.xaml.cs - HexViewport_ByteDoubleClicked() handler
V2/HexEditorV2.xaml.cs - SelectAllBytesWith() method
V2/ViewModels/HexEditorViewModel.cs - Selection management
Debug Logging:
Debug logs have been added to:
HexViewport_ByteDoubleClicked() - Shows when double-click is detected
SelectAllBytesWith() - Shows search results and selection being set
- Output visible in StatusText and System.Diagnostics.Debug.WriteLine()
Steps to Reproduce
- Open a file in HexEditorV2
- Double-click on any byte in the hex view
- Observe that the selection doesn't work as expected
Environment
- HexEditorV2 (V2 architecture with MVVM)
- Insert mode implementation active
- Custom DrawingContext rendering
Related Features
- ✅ Auto-highlight feature works (highlights matching bytes in yellow)
- ❌ Double-click selection broken
Priority
Medium - V1 compatibility feature, affects user experience but workaround exists (manual selection)
Suggested Investigation Areas
- Check if
SelectionStart and SelectionStop are being set correctly in SelectAllBytesWith()
- Verify that
OnSelectionChanged() is triggered after setting selection
- Confirm that
RefreshVisibleLines() is called to update visual representation
- Check if there's a conflict between auto-highlight and selection highlighting
- Verify the search is finding the correct matching bytes
Labels
bug
V1-compatibility
HexEditorV2
selection
Double-click byte selection not working in HexEditorV2
🐛 Bug Description
Double-clicking on a byte in HexEditorV2 should select all bytes with the same value, but the selection is not being applied correctly.
Expected Behavior
When double-clicking on a byte (e.g., value
0x41):SelectionStartshould be set to the first match positionSelectionStopshould be set to the last match positionActual Behavior
SelectAllBytesWith()method is calledTechnical Details
Implementation:
bbec374- "Fix double-click select to use real selection"dbd0522)Key Files:
V2/HexEditorV2.xaml.cs-HexViewport_ByteDoubleClicked()handlerV2/HexEditorV2.xaml.cs-SelectAllBytesWith()methodV2/ViewModels/HexEditorViewModel.cs- Selection managementDebug Logging:
Debug logs have been added to:
HexViewport_ByteDoubleClicked()- Shows when double-click is detectedSelectAllBytesWith()- Shows search results and selection being setSteps to Reproduce
Environment
Related Features
Priority
Medium - V1 compatibility feature, affects user experience but workaround exists (manual selection)
Suggested Investigation Areas
SelectionStartandSelectionStopare being set correctly inSelectAllBytesWith()OnSelectionChanged()is triggered after setting selectionRefreshVisibleLines()is called to update visual representationLabels
bugV1-compatibilityHexEditorV2selection