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

Text typed in IME mode disappears #7012

Open
t-hamano opened this issue Dec 18, 2022 · 0 comments
Open

Text typed in IME mode disappears #7012

t-hamano opened this issue Dec 18, 2022 · 0 comments

Comments

@t-hamano
Copy link

Hi.
I have encountered a problem where text entered in IME mode disappears when the following conditions are combined

  • inputStyle is contenteditable
  • Input after tab indentation
Screencast reproducing the issue

I tracked down the code and found that domTextBetween returns empty when the problem occurs.

let newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))

My guess is that the walk() function, which recursively finds text, is not finding the correct text in the case of tab indentation. I have tried to plant console.log(node) at the beginning of the walk() function, but it seems that the parsing results are different if the indentation is space or tab.

Space indent

space-indent

Tab Indent

tab-indent

As you can see, in the case of tab indentation, the span tags are nested, and I expect this is the reason why the text cannot be extracted correctly.
Perhaps we need to handle the case where span.cm-tab-wrap-hack is found.

Hope this report helps. Also, I use IME input mode all the time, and I will be happy to help with testing if you need..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant