Skip to content

Commit d0c1f3f

Browse files
committed
Fix microsoft#20811. Paste content with syntax highlight should contain empty line
1 parent 763eefd commit d0c1f3f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/vs/editor/common/viewModel/viewModelImpl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,11 @@ export class ViewModel extends EventEmitter implements IViewModel {
653653
const startOffset = (lineNumber === startLineNumber ? startColumn - 1 : 0);
654654
const endOffset = (lineNumber === endLineNumber ? endColumn - 1 : lineContent.length);
655655

656-
result += tokenizeLineToHTML(lineContent, lineTokens.inflate(), colorMap, startOffset, endOffset, tabSize);
656+
if (lineContent === '') {
657+
result += '<br>';
658+
} else {
659+
result += tokenizeLineToHTML(lineContent, lineTokens.inflate(), colorMap, startOffset, endOffset, tabSize);
660+
}
657661
}
658662

659663
return result;

0 commit comments

Comments
 (0)