Skip to content

Commit 4d62591

Browse files
committed
Fix copy on read only text (#4169)
* Fix copy from readonly code * Fix xmp text
1 parent 3190d6f commit 4d62591

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

news/2 Fixes/4168.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ctrl+c to work in code that has already been entered

src/datascience-ui/history-react/cell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export class Cell extends React.Component<ICellProps> {
345345
// Output may have goofy ascii colorization chars in it. Try
346346
// colorizing if we don't have html that needs <xmp> around it (ex. <type ='string'>)
347347
try {
348-
if (formatted.includes('<')) {
348+
if (!formatted.includes('<')) {
349349
const converter = new ansiToHtml();
350350
const html = converter.toHtml(formatted);
351351
copy.data = {

src/datascience-ui/history-react/code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class Code extends React.Component<ICodeProps, ICodeState> {
9090
theme: `${this.props.codeTheme} default`,
9191
mode: 'python',
9292
cursorBlinkRate: -1,
93-
readOnly: readOnly ? 'nocursor' : false,
93+
readOnly: readOnly ? true : false,
9494
lineWrapping: true
9595
}
9696
}

0 commit comments

Comments
 (0)