[Question] Get information of change of a model #3657
-
Context
DescriptionI use Monaco Editor and React Monaco Editor to build our own editor. An event Now, I would like to get information of comparison of newValue and oldValue: for instance, insertion of certain characters at a location, deletion of certain characters at a location, etc. Does anyone know how to get these information? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I also want to know. |
Beta Was this translation helpful? Give feedback.
-
Perhaps {
"changes": [
{
"range": {
"startLineNumber": 9,
"startColumn": 6,
"endLineNumber": 9,
"endColumn": 6
},
"rangeLength": 0,
"text": "o",
"rangeOffset": 74,
"forceMoveMarkers": false
}
],
"eol": "\n",
"versionId": 7,
"isUndoing": false,
"isRedoing": false,
"isFlush": false
} |
Beta Was this translation helpful? Give feedback.
Perhaps
editor.onDidChangeModelContent((a) => console.log(a));
is what you want