Skip to content

Commit 74e46c7

Browse files
committed
Fix analyzer warnings
1 parent b7c884e commit 74e46c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+102
-111
lines changed

SignedArchive/SignedArchive/SIGArchiveChunk.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ extern NSString *const SIGArchiveHeaderMagicString;
2929
@property (nonatomic, readonly) long long payloadOffset;
3030
@property (nullable, nonatomic, readonly) NSFileHandle *fileHandle;
3131

32-
+ (instancetype)chunkFromFileHandle:(NSFileHandle *)fileHandle
33-
atOffset:(long long)offset
34-
error:(out NSError **)error;
32+
+ (instancetype _Nullable)chunkFromFileHandle:(NSFileHandle *)fileHandle
33+
atOffset:(long long)offset
34+
error:(out NSError **)error;
3535

3636
- (instancetype)initWithTag:(SIGArchiveTag)tag
3737
length:(long long)length

ThirdParty/PSMTabBarControl/source/PSMOverflowPopUpButton.m

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ - (void)drawRect:(NSRect)rect
4242
[super drawRect:rect];
4343
return;
4444
}
45-
rect = NSIntersectionRect(rect, self.bounds);
4645

4746
NSImage *image = (_down) ? _PSMTabBarOverflowDownPopUpImage : _PSMTabBarOverflowPopUpImage;
4847
NSSize imageSize = [image size];

iTerm2.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -3064,7 +3064,6 @@
30643064
A6C763481B45C52B00E3C992 /* iTermShortcutInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D373E4818F3613600773D3E /* iTermShortcutInputView.m */; };
30653065
A6C763491B45C52B00E3C992 /* iTermTabBarControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = A6C537BD1938374600A08C18 /* iTermTabBarControlView.m */; };
30663066
A6C7634D1B45C52B00E3C992 /* PTYNoteView.m in Sources */ = {isa = PBXBuildFile; fileRef = A63F4099183B3AA7003A6A6D /* PTYNoteView.m */; };
3067-
A6C7634E1B45C52B00E3C992 /* RoundedRectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D085F9D16F137D900B7FCE9 /* RoundedRectView.m */; };
30683067
A6C763501B45C52B00E3C992 /* SolidColorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC38817148E840700B89F7C /* SolidColorView.m */; };
30693068
A6C763511B45C52B00E3C992 /* SplitSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D29732A14082A52004C5DBE /* SplitSelectionView.m */; };
30703069
A6C763541B45C52B00E3C992 /* iTermOpenQuicklyTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A69B4599197319CA00F5444D /* iTermOpenQuicklyTableCellView.m */; };
@@ -4232,6 +4231,7 @@
42324231
A6F7A74E213CB143004DE961 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = A6F7A706213CB143004DE961 /* [email protected] */; };
42334232
A6F7F8072763F47B005E433E /* VT100ScreenState.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F7F8052763F47B005E433E /* VT100ScreenState.m */; };
42344233
A6F981CC1C13783C00EE0B80 /* iTermCPS.h in Headers */ = {isa = PBXBuildFile; fileRef = A6F981CB1C13783C00EE0B80 /* iTermCPS.h */; };
4234+
A6F9821F2CA775E200229070 /* RoundedRectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D085F9D16F137D900B7FCE9 /* RoundedRectView.m */; };
42354235
A6F9EF3720850C41005530F7 /* iTermCompetentTableRowView.h in Headers */ = {isa = PBXBuildFile; fileRef = A6F9EF3520850C41005530F7 /* iTermCompetentTableRowView.h */; };
42364236
A6F9EF3820850C41005530F7 /* iTermCompetentTableRowView.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F9EF3620850C41005530F7 /* iTermCompetentTableRowView.m */; };
42374237
A6FB633123DE7DEC00026D52 /* SearchableComboListView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6FB633023DE7DEB00026D52 /* SearchableComboListView.framework */; };
@@ -15926,6 +15926,7 @@
1592615926
A631FC8E20EDDAEA00EB824F /* iTermSearchFieldCell.m in Sources */,
1592715927
A67F5DE723947A2700D18028 /* iTermMultiServerConnection.m in Sources */,
1592815928
A623D9551F8B04890011F8C3 /* iTermMetalGlue.m in Sources */,
15929+
A6F9821F2CA775E200229070 /* RoundedRectView.m in Sources */,
1592915930
53E9DFE4220D52EF0070C9C0 /* SendTextTrigger.m in Sources */,
1593015931
A67960D01F81FCBB008A42BC /* iTermBackgroundColorRenderer.mm in Sources */,
1593115932
A6DBC0391FF9B30000F1466D /* iTermTexturePool.m in Sources */,
@@ -16599,7 +16600,6 @@
1659916600
1D6578431CA5E90900358E62 /* PSMDarkHighContrastTabStyle.m in Sources */,
1660016601
A6C762CB1B45C52B00E3C992 /* iTermController.m in Sources */,
1660116602
A6C763BC1B45C52B00E3C992 /* iTermTipData.m in Sources */,
16602-
A6C7634E1B45C52B00E3C992 /* RoundedRectView.m in Sources */,
1660316603
A6C763B21B45C52B00E3C992 /* MarkTrigger.m in Sources */,
1660416604
A6C7632D1B45C52B00E3C992 /* ThreeFingerTapGestureRecognizer.m in Sources */,
1660516605
A6C763861B45C52B00E3C992 /* iTermProfilesPanel.m in Sources */,

pidinfo/pidinfo.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,12 @@ - (void)requestGitStateForPath:(NSString *)path
605605
NSPipe *pipe = [NSPipe pipe];
606606

607607
NSTask *task = [[NSTask alloc] init];
608-
task.launchPath = [NSString stringWithCString:GetPathToSelf()
608+
const char *pathToSelf = GetPathToSelf();
609+
task.launchPath = [NSString stringWithCString:pathToSelf
609610
encoding:NSUTF8StringEncoding];
611+
if (pathToSelf) {
612+
free((void *)pathToSelf);
613+
}
610614
task.arguments = @[ @"--git-state", path, [@(timeout) stringValue] ];
611615
task.standardOutput = pipe;
612616
@try {

sources/AtomicHelpers.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#import "AtomicHelpers.h"
99

10+
#import "iTermMalloc.h"
1011
#include <stdatomic.h>
1112
#include <stdlib.h>
1213

@@ -15,10 +16,8 @@
1516
} iTermAtomicInt64;
1617

1718
iTermAtomicInt64 *iTermAtomicInt64Create(void) {
18-
iTermAtomicInt64 *ai = malloc(sizeof(iTermAtomicInt64));
19-
if (ai != NULL) {
20-
atomic_init(&ai->value, 0);
21-
}
19+
iTermAtomicInt64 *ai = iTermMalloc(sizeof(iTermAtomicInt64));
20+
atomic_init(&ai->value, 0);
2221
return ai;
2322
}
2423

sources/ColorsMenuItemView.m

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ - (NSColor *)outlineColorAtIndex:(NSInteger)i enabled:(BOOL)enabled {
187187

188188
// Draw the menu item (label and colors)
189189
- (void)drawRect:(NSRect)rect {
190-
rect = NSIntersectionRect(rect, self.bounds);
191190
const BOOL enabled = self.enabled;
192191

193192
// draw the "x" (reset color to default)

sources/ComposerTextView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ extension NSRange {
969969
}
970970

971971

972-
extension NSEvent.ModifierFlags: Hashable {
972+
extension NSEvent.ModifierFlags: @retroactive Hashable {
973973

974974
}
975975

sources/FindView.m

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ - (NSString *)description {
5151
}
5252

5353
- (void)drawRect:(NSRect)dirtyRect {
54-
dirtyRect = NSIntersectionRect(dirtyRect, self.bounds);
5554
NSRect frame = [self frame];
5655
[[NSGraphicsContext currentContext] saveGraphicsState];
5756
[[NSGraphicsContext currentContext] setShouldAntialias:YES];

sources/LineBlock+SwiftInterop.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
1212

1313
@interface LineBlock(SwiftInterop)
1414

15-
- (NSData *)decompressedDataFromV4Data:(NSData *)v4data;
15+
- (NSData * _Nullable)decompressedDataFromV4Data:(NSData *)v4data;
1616

1717
@end
1818

sources/LineBlockMetadataArray.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct {
2727

2828
typedef struct {
2929
LineBlockMetadata *metadata;
30-
NSMutableIndexSet *mutableDoubleWidthCharacters;
30+
NSMutableIndexSet * _Nullable mutableDoubleWidthCharacters;
3131
} LineBlockMutableMetadata;
3232

3333
// Don't access this directly. Use the functions below.

sources/NSObject+iTerm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ NS_INLINE NSUInteger iTermCombineHash(NSUInteger hash1, NSUInteger hash2) {
115115
- (id)it_jsonSafeValue;
116116

117117
- (NSData *)it_keyValueCodedData;
118-
+ (instancetype)it_fromKeyValueCodedData:(NSData *)data;
118+
+ (instancetype _Nullable)it_fromKeyValueCodedData:(NSData *)data;
119119
- (NSString *)jsonEncoded;
120120
+ (instancetype)fromJsonEncodedString:(NSString *)string;
121121

sources/NSScreen+iTerm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
1919
+ (BOOL)it_stringLooksLikeUniqueKey:(NSString *)string;
2020
+ (double)fractionOfFrameOnAnyScreen:(NSRect)frame
2121
recommendedOrigin:(NSPoint *)recommendedOriginPtr;
22-
+ (NSScreen *)screenContainingCoordinate:(NSPoint)point;
22+
+ (NSScreen * _Nullable)screenContainingCoordinate:(NSPoint)point;
2323

2424
// Returns the visible frame modified to not include the 4 pixel boundary given to a hidden dock.
2525
// Kind of a gross hack since the magic 4 pixel number could change in the future.

sources/PTYMouseHandler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ dragSemanticHistoryWithEvent:(NSEvent *)event
122122
state:(iTermMouseState)state;
123123
- (BOOL)mouseHandlerAnyReportingModeEnabled:(PTYMouseHandler *)mouseHandler;
124124
- (void)mouseHandlerRedraw:(PTYMouseHandler *)mouseHandler;
125-
- (NSString *)mouseHandler:(PTYMouseHandler *)mouseHandler blockIDOnLine:(int)line;
125+
- (NSString * _Nullable)mouseHandler:(PTYMouseHandler *)mouseHandler blockIDOnLine:(int)line;
126126
- (BOOL)mouseHandlerMouseDownAt:(NSPoint)locationInWindow;
127127
- (BOOL)mouseHandlerMouseUp:(NSEvent *)event;
128128
- (void)mouseHandler:(PTYMouseHandler *)sender handleCommandShiftClickAtCoord:(VT100GridCoord)coord;

sources/PTYNoteView.m

-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ - (NSBezierPath *)roundedRectangleWithPointerInRect:(NSRect)frame
311311
- (void)drawRect:(NSRect)dirtyRect
312312
{
313313
[super drawRect:dirtyRect];
314-
dirtyRect = NSIntersectionRect(dirtyRect, self.bounds);
315314

316315
NSBezierPath *path = [self roundedRectangleWithPointerInRect:self.bounds
317316
inset:kInset

sources/PTYSession+ARC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
3838
metadata:(iTermImmutableMetadata)metadata
3939
lineBufferGeneration:(long long)lineBufferGeneration;
4040
- (void)maybeTurnOffPasteBracketing;
41-
- (id<iTermPopupWindowHosting>)popupHost;
41+
- (id<iTermPopupWindowHosting> _Nullable)popupHost;
4242

4343
@end
4444

sources/PTYSession.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -7943,6 +7943,7 @@ - (NSString *)regularExpressonForNonLowPrecisionSmartSelectionRulesCombined {
79437943
NSError *error = nil;
79447944
NSRegularExpression *expr = [[NSRegularExpression alloc] initWithPattern:bare options:0 error:&error];
79457945
if (error || !expr) {
7946+
[expr release];
79467947
return nil;
79477948
}
79487949
[expr release];
@@ -15886,7 +15887,7 @@ - (NSString *)requestNaturalLanguageQuery {
1588615887
const NSInteger button = [alert runSheetModalForWindow:self.view.window];
1588715888

1588815889
if (button == NSAlertFirstButtonReturn) {
15889-
return [[input string] copy];
15890+
return [[[input string] copy] autorelease];
1589015891
} else if (button == NSAlertSecondButtonReturn) {
1589115892
return nil;
1589215893
}
@@ -18166,7 +18167,7 @@ - (void)composerManager:(iTermComposerManager *)composerManager enqueueCommand:(
1816618167
return;
1816718168
}
1816818169
// Send when next mark is received.
18169-
[_commandQueue addObject:[command copy]];
18170+
[_commandQueue addObject:[[command copy] autorelease]];
1817018171
}
1817118172

1817218173
- (void)composerManager:(iTermComposerManager *)composerManager sendCommand:(NSString *)command {

sources/PTYTextView+ARC.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ iTermURLActionHelperDelegate>
6363

6464
#pragma mark - Context Menu
6565

66-
- (NSMenu *)menuForEvent:(NSEvent *)event;
66+
- (NSMenu * _Nullable)menuForEvent:(NSEvent *)event;
6767

6868
#pragma mark - Offscreen Command Line
6969

70-
- (iTermOffscreenCommandLine *)offscreenCommandLineForClickAt:(NSPoint)windowPoint;
70+
- (iTermOffscreenCommandLine * _Nullable)offscreenCommandLineForClickAt:(NSPoint)windowPoint;
7171
- (void)presentCommandInfoForOffscreenCommandLine:(iTermOffscreenCommandLine *)offscreenCommandLine
7272
event:(NSEvent *)event
7373
fromOffscreenCommandLine:(BOOL)fromOffscreenCommandLine;
@@ -127,7 +127,7 @@ iTermURLActionHelperDelegate>
127127
- (BOOL)selectionIsBig:(iTermSelection *)selection;
128128

129129
// Saves the selection as the "last" selection app-wide and returns a promise in case you need the value.
130-
- (iTermPromise<NSString *> *)recordSelection:(iTermSelection *)selection;
130+
- (iTermPromise<NSString *> * _Nullable)recordSelection:(iTermSelection *)selection;
131131

132132
- (id)selectedTextWithStyle:(iTermCopyTextStyle)style
133133
cappedAtSize:(int)maxBytes

sources/PTYTextView.m

+4-11
Original file line numberDiff line numberDiff line change
@@ -1001,13 +1001,6 @@ - (void)invalidateInputMethodEditorRect {
10011001
if ([_dataSource width] == 0) {
10021002
return;
10031003
}
1004-
int imeLines = ([_dataSource cursorX] - 1 + [self inputMethodEditorLength] + 1) / [_dataSource width] + 1;
1005-
1006-
NSRect imeRect = NSMakeRect([iTermPreferences intForKey:kPreferenceKeySideMargins],
1007-
([_dataSource cursorY] - 1 + [_dataSource numberOfLines] - [_dataSource height]) * _lineHeight,
1008-
[_dataSource width] * _charWidth,
1009-
imeLines * _lineHeight);
1010-
imeRect = [self rectWithHalo:imeRect];
10111004
[self requestDelegateRedraw];
10121005
}
10131006

@@ -5243,10 +5236,10 @@ - (VT100GridAbsCoord)absCoordForButton:(iTermTerminalButton *)button API_AVAILAB
52435236
}];
52445237
if (i == NSNotFound || !VT100GridAbsCoordEquals([self absCoordForButton:_buttons[i]], place.coord)) {
52455238
if (place.mark.copyBlockID) {
5246-
iTermTerminalButton *button = [[iTermTerminalCopyButton alloc] initWithID:place.id
5247-
blockID:place.mark.copyBlockID
5248-
mark:place.mark
5249-
absY:nil];
5239+
iTermTerminalButton *button = [[[iTermTerminalCopyButton alloc] initWithID:place.id
5240+
blockID:place.mark.copyBlockID
5241+
mark:place.mark
5242+
absY:nil] autorelease];
52505243
NSString *blockID = [[place.mark.copyBlockID copy] autorelease];
52515244

52525245
button.action = ^(NSPoint locationInWindow) {

sources/PTYTriggerEvaluator.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
2020
extern NSString *const PTYSessionSlownessEventExecute;
2121

2222
@protocol PTYTriggerEvaluatorDataSource<iTermTextDataSource>
23-
- (iTermStringLine *)stringLineAsStringAtAbsoluteLineNumber:(long long)absoluteLineNumber
24-
startPtr:(long long *)startAbsLineNumber;
23+
- (iTermStringLine * _Nullable)stringLineAsStringAtAbsoluteLineNumber:(long long)absoluteLineNumber
24+
startPtr:(long long *)startAbsLineNumber;
2525
- (int)numberOfScrollbackLines;
2626
- (int)cursorY;
2727
- (long long)totalScrollbackOverflow;
@@ -74,7 +74,7 @@ extern NSString *const PTYSessionSlownessEventExecute;
7474
- (void)checkIdempotentTriggersIfAllowed;
7575
- (void)invalidateIdempotentTriggers;
7676
- (void)appendStringToTriggerLine:(NSString *)s;
77-
- (NSString *)appendAsciiDataToCurrentLine:(AsciiData *)asciiData;
77+
- (NSString * _Nullable)appendAsciiDataToCurrentLine:(AsciiData *)asciiData;
7878
- (void)forceCheck;
7979
- (NSIndexSet *)enabledTriggerIndexes;
8080
- (void)clearTriggerLine;

sources/ProfileListView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ - (BOOL)searchFieldHasText
296296
#pragma mark - Drag drop
297297

298298
- (id<NSPasteboardWriting>)tableView:(NSTableView *)tableView pasteboardWriterForRow:(NSInteger)row {
299-
NSPasteboardItem *pbItem = [[NSPasteboardItem alloc] init];
299+
NSPasteboardItem *pbItem = [[[NSPasteboardItem alloc] init] autorelease];
300300
[pbItem setData:[self dataForRow:row]
301301
forType:kProfileTableViewDataType];
302302
return pbItem;

sources/PseudoTerminal+WindowStyle.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ iTermWindowType iTermWindowTypeNormalized(iTermWindowType windowType);
3434
- (void)toggleTraditionalFullScreenModeImpl;
3535
- (BOOL)fullScreenImpl;
3636
- (iTermWindowType)windowTypeImpl;
37-
- (IBAction)toggleFullScreenModeImpl:(id)sender;
37+
- (IBAction)toggleFullScreenModeImpl:(id _Nullable)sender;
3838
- (void)toggleFullScreenModeImpl:(id)sender
3939
completion:(void (^)(BOOL))completion;
4040
- (BOOL)togglingLionFullScreenImpl;

sources/PseudoTerminal.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -2251,7 +2251,7 @@ - (IBAction)duplicateSession:(id)sender {
22512251
PTYSession *session = self.currentSession;
22522252
MutableProfile *profile = [[session.profile mutableCopy] autorelease];
22532253
NSArray<iTermSSHReconnectionInfo *> *pendingJumps = nil;
2254-
Profile *original = [profile copy];
2254+
Profile *original = [[profile copy] autorelease];
22552255
if (session.sshIdentity) {
22562256
NSArray<iTermSSHReconnectionInfo *> *sequence = session.sshCommandLineSequence;
22572257
if ([profile[KEY_CUSTOM_COMMAND] isEqualToString:kProfilePreferenceCommandTypeSSHValue]) {
@@ -2293,7 +2293,7 @@ - (IBAction)duplicateSession:(id)sender {
22932293
DLog(@"Will use profile:\n%@", profile);
22942294
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
22952295
iTermMutableDictionaryEncoderAdapter *encoder =
2296-
[[iTermMutableDictionaryEncoderAdapter alloc] initWithMutableDictionary:dict];
2296+
[[[iTermMutableDictionaryEncoderAdapter alloc] initWithMutableDictionary:dict] autorelease];
22972297
[session encodeArrangementWithContents:YES encoder:encoder];
22982298

22992299
NSDictionary *tabArrangement = [self.currentTab arrangementWithOnlySession:session

sources/TransferrableFileMenuItemView.m

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ - (void)sanityCheckSiblings
8181

8282
- (void)drawRect:(NSRect)dirtyRect {
8383
[super drawRect:dirtyRect];
84-
dirtyRect = NSIntersectionRect(dirtyRect, self.bounds);
8584
NSColor *textColor;
8685
NSColor *grayColor;
8786

sources/VT100DCSParser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef NS_ENUM(NSInteger, VT100DCSState) {
7878
@property(nonatomic, readonly) NSString *hookDescription;
7979

8080
// Uniquely identifies this object so the main thread can avoid unhooking the wrong session.
81-
@property(nonatomic, readonly) NSString *uniqueID;
81+
@property(nonatomic, readonly, nullable) NSString *uniqueID;
8282

8383
- (void)decodeFromContext:(iTermParserContext *)context
8484
token:(VT100Token *)result

sources/VT100GridTypes.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -686,12 +686,12 @@ NS_INLINE BOOL VT100GridCoordFromDictionary(NSDictionary * _Nullable dict, VT100
686686
}
687687

688688
NSNumber *x = [NSNumber castFrom:dict[@"x"]];
689-
if (!x) {
689+
if (x != nil) {
690690
return NO;
691691
}
692692

693693
NSNumber *y = [NSNumber castFrom:dict[@"y"]];
694-
if (!y) {
694+
if (y != nil) {
695695
return NO;
696696
}
697697

sources/VT100ScreenMutableState.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
2929
@property (atomic, weak) id<VT100ScreenSideEffectPerforming> sideEffectPerformer;
3030
@property (nonatomic, readonly) iTermTokenExecutor *tokenExecutor;
3131
@property (nonatomic) BOOL exited;
32-
@property (nonatomic, strong, readonly) VT100Terminal *terminal;
32+
@property (nonatomic, strong, readonly, nullable) VT100Terminal *terminal;
3333
@property (nonatomic, strong) iTermEchoProbe *echoProbe;
3434
@property (nonatomic, weak) id<iTermEchoProbeDelegate> echoProbeDelegate;
3535
@property (nullable, nonatomic, strong) VT100ScreenState *mainThreadCopy;
@@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN
106106
- (void)appendStringAtCursor:(NSString *)string;
107107
- (void)appendScreenCharArrayAtCursor:(const screen_char_t *)buffer
108108
length:(int)len
109-
externalAttributeIndex:(id<iTermExternalAttributeIndexReading>)externalAttributes;
109+
externalAttributeIndex:(id<iTermExternalAttributeIndexReading> _Nullable)externalAttributes;
110110
- (void)appendTabAtCursor:(BOOL)setBackgroundColors;
111111
- (void)appendScreenChars:(const screen_char_t *)line
112112
length:(int)length
@@ -220,9 +220,9 @@ void VT100ScreenEraseCell(screen_char_t *sct,
220220

221221
// This is like setPromptStartLine: but with lots of side effects that are desirable for the
222222
// regular shell integration flow.
223-
- (VT100ScreenMark *)promptDidStartAt:(VT100GridAbsCoord)coord wasInCommand:(BOOL)wasInCommand detectedByTrigger:(BOOL)detectedByTrigger;
223+
- (VT100ScreenMark * _Nullable)promptDidStartAt:(VT100GridAbsCoord)coord wasInCommand:(BOOL)wasInCommand detectedByTrigger:(BOOL)detectedByTrigger;
224224

225-
- (VT100ScreenMark *)setPromptStartLine:(int)line detectedByTrigger:(BOOL)detectedByTrigger;
225+
- (VT100ScreenMark * _Nullable)setPromptStartLine:(int)line detectedByTrigger:(BOOL)detectedByTrigger;
226226
- (void)didUpdatePromptLocation;
227227
- (void)incrementClearCountForCommandMark:(id<VT100ScreenMarkReading>)screenMarkDoppelganger;
228228

@@ -273,7 +273,7 @@ void VT100ScreenEraseCell(screen_char_t *sct,
273273

274274
- (void)removeAnnotation:(id<PTYAnnotationReading>)annotation;
275275

276-
- (id<PTYAnnotationReading>)addNoteWithText:(NSString *)text inAbsoluteRange:(VT100GridAbsCoordRange)absRange;
276+
- (id<PTYAnnotationReading> _Nullable)addNoteWithText:(NSString *)text inAbsoluteRange:(VT100GridAbsCoordRange)absRange;
277277

278278
- (void)addAnnotation:(id<PTYAnnotationReading>)annotation
279279
inRange:(VT100GridCoordRange)range

sources/VT100ScreenMutableState.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ - (void)clearForComposer {
17081708
if (self.terminal.softAlternateScreenMode) {
17091709
return;
17101710
}
1711-
if (self.config.desiredComposerRows <= 0) {
1711+
if (self.config.desiredComposerRows.intValue <= 0) {
17121712
return;
17131713
}
17141714
id<VT100ScreenMarkReading> mark = [self lastPromptMark];
@@ -5660,7 +5660,7 @@ - (void)inlineImageSetMarkOnScreenLine:(NSInteger)line
56605660
self.numberOfScrollbackLines +
56615661
line);
56625662
iTermImageMark *mark = [[iTermImageMark alloc] initWithImageCode:@(code)];
5663-
mark = (iTermImageMark *)[self addMark:mark onLine:absLine singleLine:YES];
5663+
[self addMark:mark onLine:absLine singleLine:YES];
56645664
[self setNeedsRedraw];
56655665
}
56665666

0 commit comments

Comments
 (0)