Codemirror: How to clear all marks created with markText()?

Created on 7 Mar 2016  Â·  1Comment  Â·  Source: codemirror/CodeMirror

Most helpful comment

You’ll have to keep track of your marks on your own and clear them yourself when they aren’t needed anymore.

const markers = [];
markers.push(cm.markText(…));
markers.forEach(marker => marker.clear());

See documentation for doc.markText().


GitHub Issues is a bug tracker. There’s a dedicated forum for questions and user support at discuss.codemirror.net.

>All comments

You’ll have to keep track of your marks on your own and clear them yourself when they aren’t needed anymore.

const markers = [];
markers.push(cm.markText(…));
markers.forEach(marker => marker.clear());

See documentation for doc.markText().


GitHub Issues is a bug tracker. There’s a dedicated forum for questions and user support at discuss.codemirror.net.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chinchang picture chinchang  Â·  4Comments

liviuignat picture liviuignat  Â·  3Comments

JoelEinbinder picture JoelEinbinder  Â·  5Comments

alangdm picture alangdm  Â·  3Comments

qiueer picture qiueer  Â·  4Comments