[SCIM] PATCH: Extra space in preedit string

Ming Hua minghua at rice.edu
Fri Jun 4 19:59:20 PDT 2004


Hi James,

There is a bug in scim-chinese that display extra space in preedit
string, for example, when I type ``zhong guo'', the preedit string goes
like:
 z
 zh
 zho
 zhon
zhong
zhong  g
zhong gu
zhong guo

This is very annoying to me because it makes the preedit string jump
back and forth, and makes me dizzy.  I looked at the source, and I think
I have found the problem.

In src/scim_pinyin_server.cpp, the method
PinyinServerInstance::calc_preedit_string, there is already a space
added to the end of each set of parsed keys, so we don't need to add an
extra space in front of the unparsed string (it also makes an undesired
space at the beginning if we have no parsed keys).  So I have the
following simple patch, which works fine for me.

Index: src/scim_pinyin_server.cpp
===================================================================
RCS file: /cvsroot/scim/scim-chinese/src/scim_pinyin_server.cpp,v
retrieving revision 1.3
diff -u -r1.3 scim_pinyin_server.cpp
--- src/scim_pinyin_server.cpp	1 May 2004 10:51:27 -0000	1.3
+++ src/scim_pinyin_server.cpp	5 Jun 2004 02:44:33 -0000
@@ -1943,7 +1943,6 @@
 	}
 
 	if (unparsed_string.length ()) {
-		m_preedit_string += (ucs4_t) 0x0020;
 		m_preedit_string += unparsed_string;
 	}
 }

Would you please confirm this bug?  And if yes, would you please review
my patch?

Thanks,
Ming
2004.06.04

--------------------------------------------------------------------------
Physics is much too hard for physicists.                 --- David Hilbert
--------------------------------------------------------------------------



More information about the scim mailing list