Hi,
I create a marker with the command:
editor2.markText({line: tab2[click24] , ch: tab2[click2 4+1]}, {line: tab2[click24+2], ch: tab2[click2 4+3]}, {className:“aaaa”});
and I want to erase it to recreate another marker.
I test : editor2.clear(); editor2.markText.clear(); but it’s no good…
marijn
July 18, 2019, 8:15pm
2
You have to save the return value from the markText
call, and call .clear()
on that.
let myMarker = editor.markText(....)
myMarker.clear()
I tested this without success :
Blockquote
function modepasapas2(){
var myMarker;
p=click2-1;
myMarker=editor2.markText({line: tab2[click24] , ch: tab2[click2 4+1]}, {line: tab2[click24+2], ch: tab2[click2 4+3]}, {className:“aaaa”});
if(p==1){myMarker.clear();}
/alert(tab2[click2 4]+“,”+tab2[click24+1]+“,”+ tab2[click2 4+2]+“,”+ tab2[click24+3]); /
click2++;
Summary
This text will be hidden
marijn
July 19, 2019, 6:24pm
4
That code does the clearing immediately after creating the marker, which suggests that you’re having some trouble with more basic concepts such as control flow. My book (free online) might help with these basics.