Inputing via the fcitx input methods on debian, the first character in a new paragraph is wrong

  • os: debian 10
  • input methods: Google Pinyin for Fcitx, Pinyin for Fcitx, WubiPinyin for Fcitx

I’m a chinese, and I use the WubiPinyin for Fcitx everyday. Usually I need to press more than one keys to input one chinese character.

Take the WubiPinyin for example, as shown in the gif below, I entered ‘w’, and then the chinese character ‘人’ appeared at the cursor. I continued to enter ‘q’, and the chinese character ‘人’ at the cursor was replaced with ‘你’. Finally after I pressed the space bar, the ‘你’ was inputed.

normal

I found that in a prosemirror editor, something went wrong! After I entered ‘w’ using the WubiPinyin in a new paragraph, the chinese character ‘人’ appeared as expected. But when I entered ‘q’ and pressed the space bar, nothing changed.

wrong

I wrote a simple script to inspect the input events.

<html>
	<head>
		<script>
			function output(e) {
				console.log(e);
			}
		</script>
	</head>
	<body>
		<input type="text" oninput="output(event)">
	</body>
</html>

the input events emitted when I pressed ‘w’, ‘q’ and the space bar using the WubiPinyin

I tried to input chinese characters in the prosemirror editor via input methods on macbook and widnows 10, and it was all right!

the input events emitted when I pressed ‘w’, ‘q’ and the space bar using a input method for Windows 10

I don’t have fcitx setup, but could reproduce a similar issue with IBus Pinyin IME. Could you see if attached patch (released in prosemirror-view 1.23.8) helps for you?

2 Likes

It works! Thanks!!!