r1298 - branches/bxe_2_0/mozile

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Wed May  4 14:03:40 2005
New Revision: 1298

Modified:
   branches/bxe_2_0/mozile/mozilekb.js
Log:
http://bugs.bitflux.ch/cgi-bin/bugzilla/show_bug.cgi?id=783 
whitespace not printed while typing

Modified: branches/bxe_2_0/mozile/mozilekb.js
==============================================================================
--- branches/bxe_2_0/mozile/mozilekb.js	(original)
+++ branches/bxe_2_0/mozile/mozilekb.js	Wed May  4 14:03:40 2005
@@ -552,10 +552,15 @@
 		var startOff = cssr.startOffset;
 		sel.collapse( startC, startOff);
 		var _ch = String.fromCharCode(event.charCode);
-		//FIXME, show correct spaces...
-		/*if (event.charCode  == CHARCODE_SPACE ) {
+		if(startOff > 0) {
+			if (startC.substringData(startOff-1,1) == STRING_NBSP) {
+				startC.replaceData(startOff-1,1," ");
+			}
+		}
+		//FIXME, not sure, if that works correctly...
+		if (event.charCode  == CHARCODE_SPACE ) {
 			startC.insertData(startOff, STRING_NBSP);
-		} else */ {
+		} else  {
 			startC.insertData(startOff, _ch);
 		}
 		
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.