This commit is contained in:
2025-11-12 17:55:59 +08:00
parent 2f4205ad1a
commit 66b7a9218e
2 changed files with 18 additions and 2 deletions

View File

@@ -289,6 +289,15 @@ static NSUInteger kb_validUTF8PrefixLen(NSData *data) {
- (void)emitChunk:(NSString *)rawText {
if (rawText.length == 0) return;
NSString *text = rawText;
// 0) \r/\n "\n\t""\r\n\t""\r\t" "\t"
text = [text stringByReplacingOccurrencesOfString:@"\r\n\t" withString:@"\t"];
text = [text stringByReplacingOccurrencesOfString:@"\n\t" withString:@"\t"];
text = [text stringByReplacingOccurrencesOfString:@"\r\t" withString:@"\t"];
while (text.length > 0) {
unichar c0 = [text characterAtIndex:0];
if (c0 == '\n' || c0 == '\r') { text = [text substringFromIndex:1]; continue; }
break;
}
// 1) /t -> \t
if (self.treatSlashTAsTab) {
text = [text stringByReplacingOccurrencesOfString:@"/t" withString:@"\t"];

View File

@@ -99,7 +99,7 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
//
[self addSubview:self.rightButtonContainer];
[self.rightButtonContainer mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.mas_right).offset(-12);
make.right.equalTo(self.mas_right).offset(-6);
make.top.equalTo(self.barViewInternal.mas_bottom).offset(8);
make.bottom.equalTo(self.mas_bottom).offset(-10);
make.width.mas_equalTo(72);
@@ -208,10 +208,15 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
[self addSubview:overlay];
[overlay mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_left).offset(12);
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-12);
// rightButtonContainer
make.right.equalTo(self.mas_right).offset(-12);
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(10);
make.bottom.equalTo(self.mas_bottom).offset(-10);
}];
// overlay
self.rightButtonContainer.hidden = YES;
//
overlay.textView.contentHorizontalPadding = 8.0;
self.streamOverlay = overlay;
// UI cell start
@@ -223,6 +228,8 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
[self.streamOverlay removeFromSuperview];
self.streamOverlay = nil;
self.tagListView.hidden = NO;
//
self.rightButtonContainer.hidden = NO;
}
//