How block copy collapse text?

i’m looking for a way emit certain text when copy all contents of codemirror’s ,

so, when data is like this

{
    "id": "1",
   "name": "jason",
   "age": "29"
}

using collapse option and hide ‘id’ text line from collapse option

Codemirror.markText(from, to, {
          collapsed: true,
  })

{
   "name": "jason",
   "age": "29"
}

how to block copy collpase text when copy from ctrl A + ctrl C?

I don’t quite understand your question, but collapsed text is copied when you have it selected.

when collapse some text line like
"id": "1",

what i want do do is copy all of text (ctrl A + ctrl C), except collapse line
then pasted result is

{
   "name": "jason",
   "age": "29"
}

-- collapse "id": "1", text

but collapsed text still copied when selected, how can i hide certain text and block this text from copy?

That’s not something CodeMirror supports—if you want content to not show up on the clipboard, you’ll have to actually delete it from the document.

Thanks for reply :slight_smile:

how about extraKeys option?
is it impossible solve this problem using override Cmd-C(V) or Ctrl-C(V) command…?

If this not work too… i have to find another options :frowning: