How block copy collapse text?


#1

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?


#2

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


#3

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?


#4

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.


#5

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: