From c4028ef54b2073b956c79bed48afdcf7ce8942b5 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 29 Nov 2016 21:38:26 -0500 Subject: [PATCH] Fix BSSourceView not re-drawing when the marked line or breakpoints change. --- Source/BSSourceView.h | 10 +++++----- Source/BSSourceView.mm | 12 ++++++++++++ Source/BreakpointController.m | 1 - 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Source/BSSourceView.h b/Source/BSSourceView.h index 189085a..c310113 100644 --- a/Source/BSSourceView.h +++ b/Source/BSSourceView.h @@ -41,12 +41,12 @@ id delegate_; } -@property (readonly) NSTextView* textView; -@property (readonly) NSScrollView* scrollView; -@property (retain) NSSet* markers; +@property (nonatomic, readonly) NSTextView* textView; +@property (nonatomic, readonly) NSScrollView* scrollView; +@property (nonatomic, retain) NSSet* markers; @property (nonatomic, assign) NSString* file; -@property (assign) NSUInteger markedLine; -@property (assign) id delegate; +@property (nonatomic, assign) NSUInteger markedLine; +@property (nonatomic, assign) id delegate; - (void)setFile:(NSString*)f; - (void)setString:(NSString*)source asFile:(NSString*)path; diff --git a/Source/BSSourceView.mm b/Source/BSSourceView.mm index 8669d9e..0e0bc0e 100644 --- a/Source/BSSourceView.mm +++ b/Source/BSSourceView.mm @@ -64,6 +64,18 @@ [super dealloc]; } +- (void)setMarkers:(NSSet*)markers { + [markers_ release]; + markers_ = [markers copy]; + + [ruler_ setNeedsDisplay:YES]; +} + +- (void)setMarkedLine:(NSUInteger)markedLine { + markedLine_ = markedLine; + [ruler_ setNeedsDisplay:YES]; +} + /** * Sets the file name as well as the text of the source view */ diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index f6b9028..3f61811 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -107,7 +107,6 @@ } [sourceView setMarkers:[NSSet setWithArray:[manager breakpointsForFile:file]]]; - [sourceView setNeedsDisplay:YES]; } /** -- 2.22.5