Skip to content

Commit

Permalink
Don't update memory viewer contents while data inspector is editing
Browse files Browse the repository at this point in the history
Fixes bug where the data inspector text file discards editing mode soon after entering it.
  • Loading branch information
zorgiepoo committed Aug 18, 2024
1 parent e6ae97e commit e6ae84e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Bit Slicer/ZGMemoryViewerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ - (void)hexTextView:(HFTextView *)__unused representer didChangeProperties:(HFCo

- (void)updateDisplayTimer:(NSTimer *)__unused timer
{
if (_currentMemorySize > 0)
if (_currentMemorySize > 0 && !_dataInspectorRepresenter.zg_editing)
{
HFFPRange displayedLineRange = _textView.controller.displayedLineRange;

Expand Down
3 changes: 3 additions & 0 deletions deps/HexFiend/DataInspectorRepresenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ extern NSString * const DataInspectorDidDeleteAllRows;

- (NSUInteger)rowCount;

// Bit Slicer addition: is the data inspector being edited?
@property (nonatomic, readonly) BOOL zg_editing;

- (IBAction)addRow:(id)sender;
- (IBAction)removeRow:(id)sender;
- (IBAction)doubleClickedTable:(id)sender;
Expand Down
5 changes: 5 additions & 0 deletions deps/HexFiend/DataInspectorRepresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ - (IBAction)doubleClickedTable:(id)sender {
}
}

- (BOOL)zg_editing
{
return table.editedRow != -1;
}

- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor {
USE(control);
NSInteger row = [table editedRow];
Expand Down

0 comments on commit e6ae84e

Please sign in to comment.