opened 08:19PM - 02 Feb 22 UTC
Similar to https://github.com/codemirror/codemirror.next/issues/691
When sele…cting across multiple lines and typing something to replace the selection, ZeroWidthSpace characters generated from replacements and widgets shows up.
- Open https://codemirror.net/6/ in Chrome.
- Run the following code block in dev console.
- Select from the first line to the second, just before the replacement (`234\n1`)
.
- Type any character.
- Observe red dot "Control character zero width space" showing up.
```js
const {EditorState, EditorView, basicSetup} = CM["@codemirror/basic-setup"];
const {WidgetType, Decoration, ViewPlugin, highlightSpecialChars} = CM["@codemirror/view"];
const {RangeSetBuilder} = CM["@codemirror/rangeset"];
const {StateField} = CM["@codemirror/state"];
let text = '1234\n1234\n1234';
let decos = Decoration.set([Decoration.replace({}).range(6,8)]);
let plugin = ViewPlugin.define(view => {}, {decorations: v => decos});
let state = EditorState.create({
doc: text,
extensions: [basicSetup, highlightSpecialChars(), plugin]
});
view.setState(state);
```
