Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to #691
When selecting across multiple lines and typing something to replace the selection, ZeroWidthSpace characters generated from replacements and widgets shows up.
234\n1
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);
The text was updated successfully, but these errors were encountered:
codemirror/view@9e72559
Heh, damn, I knew we'd have bugs like this. Attached patch makes the zero-width space stripping more aggressive.
Sorry, something went wrong.
Use hidden images instead of zero-width spaces for widget buffers
d50dc90
Issue codemirror/codemirror.next#652 Issue codemirror/codemirror.next#539 See https://discuss.codemirror.net/t/entering-cjk-with-placeholder-causes-problems-with-the-first-character/3876 Issue codemirror/codemirror.next#713 FIX: Fix several issues where editing or composition went wrong due to our zero-width space kludge characters ending up in unexpected places.
Successfully merging a pull request may close this issue.
Similar to #691
When selecting across multiple lines and typing something to replace the selection, ZeroWidthSpace characters generated from replacements and widgets shows up.
234\n1)The text was updated successfully, but these errors were encountered: