Skip to content
New issue

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

Windows IME confused when typing next to replacements #652

Closed
lishid opened this issue Dec 24, 2021 · 5 comments
Closed

Windows IME confused when typing next to replacements #652

lishid opened this issue Dec 24, 2021 · 5 comments

Comments

@lishid
Copy link

@lishid lishid commented Dec 24, 2021

When typing full-width punctuation characters at the exact spot that a replacement has happened, the Chinese IME on Windows ends up doing really weird things. I think it's getting confused by the ​.

Basic test case:

const {EditorState, EditorView, basicSetup} = CM["@codemirror/basic-setup"];
const {WidgetType, Decoration, ViewPlugin} = CM["@codemirror/view"];
const {StateField} = CM["@codemirror/state"];
let text = '1\nasdfasdf\n3\n4';
let decos = Decoration.set([Decoration.replace({}).range(4, 8)]);
let plugin = ViewPlugin.define(view => ({view}), {decorations: v => decos});
let state = EditorState.create({
	doc: text,
	extensions: [basicSetup, plugin]
});
view.setState(state);

test

@lishid
Copy link
Author

@lishid lishid commented Dec 30, 2021

Same thing happens when using Windows's emoji tool:

test

@AndyLiu9
Copy link

@AndyLiu9 AndyLiu9 commented Feb 8, 2022

Really sorry to bother, is there any update on this issue?

@Masktial
Copy link

@Masktial Masktial commented Feb 11, 2022

Hope it could be fixed soon sincerely.
Desperately!

@marijnh
Copy link
Member

@marijnh marijnh commented Feb 11, 2022

This is likely the same problem as https://discuss.codemirror.net/t/entering-cjk-with-placeholder-causes-problems-with-the-first-character/3876 . It indeed seems like the zero-width spaces are ruining everything again. I'm going to try and see if I can replace that hack with another less leaky hack.

marijnh added a commit to codemirror/view that referenced this issue Feb 11, 2022
@marijnh
Copy link
Member

@marijnh marijnh commented Feb 11, 2022

I believe patch codemirror/view@d50dc90 solves this.

@marijnh marijnh closed this Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants