When executing completion on CodeMirror, full-text are replaced because the contents are updated using CodeMirror#setValue.
We want to use CodeMirror#replaceRange so that we only need to update the required range.
When referring to change event, it will cause unnecessarily large change events.
This can be a problem if you need to create changelogs or send changes for simultaneous editing, for example.
Here are some suggestions I'm currently considering for that purpose.
Add information to the return value of SearchResult#replace that includes the replace range and the text after replacement.
Use the values in @textcomplete/codemirror to replace the required range.
Make the return value of SearchResult#replace only the range of the replacement and the text after the replacement, and adjust it in each packages that are the caller.
When executing completion on CodeMirror, full-text are replaced because the contents are updated using
CodeMirror#setValue
. We want to useCodeMirror#replaceRange
so that we only need to update the required range.When referring to change event, it will cause unnecessarily large change events. This can be a problem if you need to create changelogs or send changes for simultaneous editing, for example.
Here are some suggestions I'm currently considering for that purpose.
SearchResult#replace
that includes the replace range and the text after replacement.@textcomplete/codemirror
to replace the required range.SearchResult#replace
only the range of the replacement and the text after the replacement, and adjust it in each packages that are the caller.