Skip to content

Commit d949fd3

Browse files
committed
Don't create markdown previews if cell is in edit mode
1 parent d7c0ea5 commit d949fd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/viewportCustomMarkdown/viewportCustomMarkdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { RunOnceScheduler } from 'vs/base/common/async';
77
import { Disposable } from 'vs/base/common/lifecycle';
8-
import { INotebookEditor, INotebookEditorContribution } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
8+
import { CellEditState, INotebookEditor, INotebookEditorContribution } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
99
import { registerNotebookContribution } from 'vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
1010
import { CellKind, cellRangesToIndexes } from 'vs/workbench/contrib/notebook/common/notebookCommon';
1111

@@ -28,7 +28,7 @@ class NotebookClipboardContribution extends Disposable implements INotebookEdito
2828
cellRangesToIndexes(visibleRanges).forEach(index => {
2929
const cell = this._notebookEditor.viewModel?.viewCells[index];
3030

31-
if (cell?.cellKind === CellKind.Markdown) {
31+
if (cell?.cellKind === CellKind.Markdown && cell?.editState === CellEditState.Preview) {
3232
this._notebookEditor.createMarkdownPreview(cell);
3333
}
3434
});

0 commit comments

Comments
 (0)