🎨 Update
This commit is contained in:
19
frontend/src/views/editor/extensions/vscodeSearch/state.ts
Normal file
19
frontend/src/views/editor/extensions/vscodeSearch/state.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { StateEffect, StateField } from "@codemirror/state";
|
||||
|
||||
// Define an effect to update the visibility state
|
||||
export const SearchVisibilityEffect = StateEffect.define<boolean>();
|
||||
|
||||
// Create a state field to store the visibility state
|
||||
export const searchVisibilityField = StateField.define({
|
||||
create() {
|
||||
return false;
|
||||
},
|
||||
update(value, tr) {
|
||||
for (let e of tr.effects) {
|
||||
if (e.is(SearchVisibilityEffect)) {
|
||||
return e.value;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user