Skip to content

Commit a668ae6

Browse files
authored
Fix microsoft#180861. Cell stays in editing mode if it is not modified by find. (microsoft#180902)
1 parent 8e4aae8 commit a668ae6

File tree

1 file changed

+7
-1
lines changed
  • src/vs/workbench/contrib/notebook/browser/contrib/find

1 file changed

+7
-1
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ export class FindModel extends Disposable {
148148
if (cell && cell.cellKind === CellKind.Markup) {
149149
const foundContentMatch = contentMatches.find(m => m.cell.handle === cell.handle && m.contentMatches.length > 0);
150150
const targetState = foundContentMatch ? CellEditState.Editing : CellEditState.Preview;
151-
if (cell.getEditState() !== targetState) {
151+
const currentEditingState = cell.getEditState();
152+
153+
if (currentEditingState === CellEditState.Editing && cell.editStateSource !== 'find') {
154+
// it's already in editing mode, we should not update
155+
continue;
156+
}
157+
if (currentEditingState !== targetState) {
152158
cell.updateEditState(targetState, 'find');
153159
}
154160
}

0 commit comments

Comments
 (0)