silverbullet/web/cm_plugins/readonly.ts

8 lines
167 B
TypeScript
Raw Normal View History

2023-01-16 18:28:59 +08:00
import { EditorState } from "../deps.ts";
export function readonlyMode() {
return EditorState.changeFilter.of((tr): boolean => {
return !tr.docChanged;
});
}