Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #180861. Cell stays in editing mode if it is not modified by find. #180902

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ export class FindModel extends Disposable {
if (cell && cell.cellKind === CellKind.Markup) {
const foundContentMatch = contentMatches.find(m => m.cell.handle === cell.handle && m.contentMatches.length > 0);
const targetState = foundContentMatch ? CellEditState.Editing : CellEditState.Preview;
if (cell.getEditState() !== targetState) {
const currentEditingState = cell.getEditState();

if (currentEditingState === CellEditState.Editing && cell.editStateSource !== 'find') {
// it's already in editing mode, we should not update
continue;
}
if (currentEditingState !== targetState) {
cell.updateEditState(targetState, 'find');
}
}
Expand Down