Skip to content

Commit 781e5e9

Browse files
committed
Merge pull request #1 from revolter/master
Reduced number of steps
2 parents 62a64bf + 017696f commit 781e5e9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CComment/CComment.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ - (NSString *)singleLine:(NSString *)source range:(NSRange *)prange
137137
} else if (result == 0 || result == -2) {
138138
return nil;
139139
} else {
140-
return [NSString stringWithFormat:@"/*%@*/", value];
140+
return [NSString stringWithFormat:@"/* %@ */", value];
141141
}
142142
}
143143

@@ -177,7 +177,7 @@ - (NSString *)multiLine:(NSString *)source range:(NSRange *)prange
177177
} else if (result == 0 || result == -2) {
178178
return nil;
179179
} else {
180-
return [NSString stringWithFormat:@"/*%@*/", value];
180+
return [NSString stringWithFormat:@"/* %@ */", value];
181181
}
182182
}
183183

CComment/Xcode.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ + (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString
107107
[[document textStorage] beginEditing];
108108
[[document textStorage] replaceCharactersInRange:range withString:aString withUndoManager:[document undoManager]];
109109
[[document textStorage] endEditing];
110+
111+
NSInteger commentRightPartLength = 3; // " */"
112+
[[self textView] setSelectedRange:NSMakeRange(range.location + aString.length - commentRightPartLength, 0)];
110113
}
111114

112115
@end

0 commit comments

Comments
 (0)