Index: org/gjt/sp/jedit/OperatingSystem.java
===================================================================
RCS file: /cvsroot/jedit/jEdit/org/gjt/sp/jedit/OperatingSystem.java,v
retrieving revision 1.16
diff -u -r1.16 OperatingSystem.java
--- org/gjt/sp/jedit/OperatingSystem.java	25 Dec 2003 00:09:42 -0000	1.16
+++ org/gjt/sp/jedit/OperatingSystem.java	16 Jun 2004 02:17:19 -0000
@@ -141,17 +141,18 @@
 		
 		if (isMacOS())
 		{
+			// ??? is this correct in multi-display environment ??? 
 			x = screenX;
 			y = screenY + 22;
 			w = screenW;
-			h = screenH - y - 4;//shadow size
+			h = screenH - 22 - 4;//shadow size
 		}
 		else if (isWindows())
 		{
 			x = screenX - 4;
 			y = screenY - 4;
-			w = screenW - 2*x;
-			h = screenH - 2*y;
+			w = screenW + 8;
+			h = screenH + 8;
 		}
 		else
 		{
Index: org/gjt/sp/jedit/syntax/Chunk.java
===================================================================
RCS file: /cvsroot/jedit/jEdit/org/gjt/sp/jedit/syntax/Chunk.java,v
retrieving revision 1.13
diff -u -r1.13 Chunk.java
--- org/gjt/sp/jedit/syntax/Chunk.java	29 Apr 2003 01:05:44 -0000	1.13
+++ org/gjt/sp/jedit/syntax/Chunk.java	16 Jun 2004 02:17:20 -0000
@@ -331,6 +331,35 @@
 			str = new String(seg.array,seg.offset + offset,length);
 			gv = style.getFont().createGlyphVector(
 				fontRenderContext,str);
+
+			//{{{ adjust same spacing as plain font
+			// this operation adjusts bold spacings to same as plain spacings.
+			// it is very easy way.
+			// if you implement same as this operation, another way, 
+			// you must be in consider to
+			//	full width character(CJK)
+			//	supplementary character,  combining, etc(unicode)
+			if(style.isSameSpacingAsPlainFont() 
+				&& !style.getFont().isPlain())
+			{
+				// you must create pgv by same method as gv. 
+				// for example, if you support bidi, you would use
+				// java.awt.Font#layoutGlyphVector(java.awt.font.FontRenderContext,char[],int,int,int) 
+				// to create gv. hereby you must use
+				// java.awt.Font#layoutGlyphVector(java.awt.font.FontRenderContext,char[],int,int,int) 
+				// to create pgv.
+				Font plain = style.getFont().deriveFont(Font.PLAIN);
+				GlyphVector pgv = plain.createGlyphVector(
+					fontRenderContext,str);
+
+				//termination condition expression is correct.
+				//@see java.awt.font.GlyphVector#setGlyphPosition(int, java.awt.geom.Point2D)
+				//@see java.awt.font.GlyphVector#getGlyphPosition(int, java.awt.geom.Point2D)
+				for(int i = 0; i <= gv.getNumGlyphs(); i++)
+					gv.setGlyphPosition(i,pgv.getGlyphPosition(i));
+			}
+			//}}}
+
 			width = (float)gv.getLogicalBounds().getWidth();
 		}
 	} //}}}
Index: org/gjt/sp/jedit/syntax/SyntaxStyle.java
===================================================================
RCS file: /cvsroot/jedit/jEdit/org/gjt/sp/jedit/syntax/SyntaxStyle.java,v
retrieving revision 1.5
diff -u -r1.5 SyntaxStyle.java
--- org/gjt/sp/jedit/syntax/SyntaxStyle.java	14 Mar 2003 02:51:25 -0000	1.5
+++ org/gjt/sp/jedit/syntax/SyntaxStyle.java	16 Jun 2004 02:17:20 -0000
@@ -94,10 +94,36 @@
 		this.charWidth = charWidth;
 	} //}}}
 
+	//{{{ isSameSpacingAsPlainFont() method
+	/**
+	 * Returns whether adjusts at same spacing as a plain font.
+	 * 
+	 * @return true if adjusts at same spacing as a plain font, 
+	 *         otherwise not.
+	 */
+	public boolean isSameSpacingAsPlainFont()
+	{
+		return this.sameSpacingAsPlainFont;
+	}
+	//}}}
+
+	//{{{ setSameSpacingAsPlainFont(boolean) method
+	/**
+	 * set whether adjusts at same spacing as a plain font.
+	 * 
+	 * @param sameSpacingAsPlainFont whether adjusts at same spacing as a plain font.
+	 */
+	 public void setSameSpacingAsPlainFont(boolean sameSpacingAsPlainFont)
+	 {
+		 this.sameSpacingAsPlainFont = sameSpacingAsPlainFont;
+	 }
+	//}}}
+	
 	//{{{ Private members
 	private Color fgColor;
 	private Color bgColor;
 	private Font font;
 	private int charWidth;
+	private boolean sameSpacingAsPlainFont;
 	//}}}
 }
Index: org/gjt/sp/jedit/textarea/JEditTextArea.java
===================================================================
RCS file: /cvsroot/jedit/jEdit/org/gjt/sp/jedit/textarea/JEditTextArea.java,v
retrieving revision 1.316
diff -u -r1.316 JEditTextArea.java
--- org/gjt/sp/jedit/textarea/JEditTextArea.java	29 May 2004 01:55:26 -0000	1.316
+++ org/gjt/sp/jedit/textarea/JEditTextArea.java	16 Jun 2004 02:17:25 -0000
@@ -26,6 +26,7 @@
 //{{{ Imports
 import java.awt.*;
 import java.awt.event.*;
+import java.awt.im.InputMethodRequests;
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -4979,6 +4980,13 @@
 		remove(comp);
 	} //}}}
 
+	//{{{ getInputMethodRequests() method
+	public InputMethodRequests getInputMethodRequests()
+	{
+		return painter.getInputMethodRequests();
+	}
+	//}}}
+
 	//}}}
 
 	//{{{ propertiesChanged() method
@@ -5288,6 +5296,16 @@
 	{
 		int max = chunkCache.getMaxHorizontalScrollWidth();
 
+		//{{{ for pseudo over-the-spot input support
+		Object obj = painter.getInputMethodRequests();
+		if(obj != null && obj instanceof TextAreaPainter.PaintComposedText)
+		{
+			TextAreaPainter.PaintComposedText composedText
+				= (TextAreaPainter.PaintComposedText)obj;
+			max = Math.max(max, composedText.getComposedTextEndX());
+		}
+		//}}}
+
 		if(max != maxHorizontalScrollWidth)
 		{
 			maxHorizontalScrollWidth = max;
Index: org/gjt/sp/jedit/textarea/TextAreaPainter.java
===================================================================
RCS file: /cvsroot/jedit/jEdit/org/gjt/sp/jedit/textarea/TextAreaPainter.java,v
retrieving revision 1.97
diff -u -r1.97 TextAreaPainter.java
--- org/gjt/sp/jedit/textarea/TextAreaPainter.java	28 Apr 2004 18:18:40 -0000	1.97
+++ org/gjt/sp/jedit/textarea/TextAreaPainter.java	16 Jun 2004 02:17:27 -0000
@@ -26,13 +26,21 @@
 import javax.swing.text.*;
 import javax.swing.JComponent;
 import java.awt.event.MouseEvent;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.InputMethodListener;
+import java.awt.im.InputMethodRequests;
 import java.awt.font.*;
 import java.awt.*;
+import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
+import java.text.AttributedString;
+import java.text.CharacterIterator;
 import java.util.HashMap;
 import org.gjt.sp.jedit.buffer.IndentFoldHandler;
 import org.gjt.sp.jedit.syntax.*;
 import org.gjt.sp.jedit.Buffer;
 import org.gjt.sp.jedit.Debug;
+import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.util.Log;
 //}}}
 
@@ -135,6 +143,12 @@
 	public static final int CARET_LAYER = 300;
 
 	/**
+	 * composed text layer. Most extensions will be below this layer.
+	 * @since 
+	 */
+	public static final int COMPOSED_TEXT_LAYER = 400;
+
+	/**
 	 * Highest possible layer.
 	 * @since jEdit 4.0pre4
 	 */
@@ -216,6 +230,8 @@
 		for(int i = 0; i < styles.length; i++)
 		{
 			styles[i].setCharWidth(getCharWidth(styles[i].getFont()));
+			styles[i].setSameSpacingAsPlainFont(
+				jEdit.getBooleanProperty("view.sameSpacingAsPlainFont"));
 		}
 		repaint();
 	} //}}}
@@ -750,6 +766,13 @@
 		return getPreferredSize();
 	} //}}}
 
+	//{{{ getInputMethodRequests() method
+	public InputMethodRequests getInputMethodRequests()
+	{
+		return composedTextExtension;
+	}
+	//}}}
+
 	//{{{ Package-private members
 
 	//{{{ Instance variables
@@ -811,6 +834,13 @@
 			.Highlight(textArea));
 		addExtension(TEXT_LAYER,new PaintText());
 		caretExtension = new PaintCaret();
+
+		if(jEdit.getBooleanProperty("view.enableInputMethod"))
+		{
+			composedTextExtension = new PaintComposedText();
+			addExtension(COMPOSED_TEXT_LAYER, composedTextExtension);
+			textArea.addInputMethodListener(composedTextExtension);
+		}
 	} //}}}
 
 	//}}}
@@ -820,6 +850,7 @@
 	//{{{ Instance variables
 	private ExtensionManager extensionMgr;
 	private PaintCaret caretExtension;
+	private PaintComposedText composedTextExtension;
 	private RenderingHints renderingHints;
 	private FontRenderContext fontRenderContext;
 	private HashMap fonts;
@@ -871,7 +902,37 @@
 				maxWidth = Math.max(width,maxWidth);
 			}
 
-			String str = "iwiwiwiau1234";
+			//{{{check some characters
+			//The above check and the following check are 
+			// unconsidered to Japanese characters.
+			//Those checks are wrong in some Japanese fonts.
+			//This check is correct this problem.
+			//However this check is incomplete, too.
+			//if you want complete check, you must check characters in all language.
+			//I think that "view.monospaceHack" option is reasonable than those check.
+
+			//contents of jpChars
+			// 1st hiragana letter a
+			// 2nd katakana letter a
+			// 3rd a character in CJK unified ideographs
+			// 4th full width plus sign
+			// 5th a character in Hangul Syllabkes
+			String testChars = "\u3042\u30A2\u5B57\uFF0B\uAC00";
+			GlyphVector gv = font.createGlyphVector(textArea.getPainter()
+				.getFontRenderContext(),testChars);
+			for(int i = 0; i < gv.getNumGlyphs(); i++)
+			{
+				if(!font.canDisplay(testChars.charAt(i))) 
+					continue;
+
+				double width = gv.getGlyphPosition(i+1).getX()
+					- gv.getGlyphPosition(i).getX();
+				minWidth = (int)Math.min(width,minWidth);
+				maxWidth = (int)Math.max(width,maxWidth);
+			}
+			//}}}
+
+			String str = "iwiwiwiau12340";
 			double width1 = font.createGlyphVector(textArea.getPainter()
 				.getFontRenderContext(),str).getLogicalBounds()
 				.getWidth();
@@ -1153,19 +1214,405 @@
 			int caretX = textArea.returnValue.x;
 			int height = fm.getHeight();
 
+			//followings are consider to full width character.
+			int width;
+			if((caret < textArea.getLineEndOffset(physicalLine) - 1)
+				&& !textArea.getText(caret,1).equals("\t"))
+				width = textArea.offsetToXY(physicalLine,offset+1,
+					textArea.returnValue).x - caretX;
+			else
+				width = textArea.charWidth;
+
 			gfx.setColor(caretColor);
 
 			if(textArea.isOverwriteEnabled())
 			{
 				gfx.drawLine(caretX,y + height - 1,
-					caretX + textArea.charWidth,y + height - 1);
+					caretX + width,y + height - 1);
 			}
 			else if(blockCaret)
-				gfx.drawRect(caretX,y,textArea.charWidth - 1,height - 1);
+				gfx.drawRect(caretX,y,width - 1,height - 1);
 			else
 				gfx.drawLine(caretX,y,caretX,y + height - 1);
 		}
 	} //}}}
 
+	//{{{ PaintComposedText class
+	/**
+	 * pseudo over-the-spot input support.
+	 * 
+	 * if you want to enable this extension,  
+	 *   write "view.enableInputMethod=true" into your property file,
+	 *   and restart jEdit.
+	 */
+	class PaintComposedText extends TextAreaExtension 
+		implements InputMethodRequests, InputMethodListener {
+
+		private String composedString;
+		private AttributedString composedAttributedString;
+		private TextLayout composedTextLayout;
+
+		private TextHitInfo composedCaret;
+		private int composedCaretX;
+
+		private int composedTextEndX;
+
+		/**
+		 * paint method
+		 */
+		public void paintValidLine(Graphics2D gfx, int screenLine,
+			int physicalLine, int start, int end, int y)
+		{
+			if(composedString == null)
+				return;
+
+			int caret = textArea.getCaretPosition();
+			if(caret < start || caret >= end)
+				return;
+
+			int offset = caret - textArea.getLineStartOffset(physicalLine);
+			textArea.offsetToXY(physicalLine,offset,textArea.returnValue);
+			int caretX = textArea.returnValue.x;
+			int height = fm.getHeight();
+
+			if(0 < composedString.length()){
+				gfx.setColor(getBackground());
+				gfx.fillRect(textArea.returnValue.x, y, 
+					fm.stringWidth(composedString), fm.getHeight());
+				gfx.setColor(getForeground());
+				gfx.drawString(composedAttributedString.getIterator(), 
+					textArea.returnValue.x, y + fm.getAscent());
+			}
+
+			if(textArea.isCaretVisible() && composedCaret != null){
+				caretX += composedCaretX;
+				gfx.setColor(caretColor);
+				gfx.drawLine(caretX, y, caretX, y + height - 1);
+			}
+		}
+
+		//{{{ InputMethodRequests
+		/**
+		 * get the current caret position.
+		 * position is "absolute position" on screen,
+		 * not "relative position" on componenet.
+		 * 
+		 * @param offset if there is composed text, the offset within the composed text.
+		 *               if there is no composed text, null.
+		 *               0 means start of composed text.
+		 *               However, in my experience, this parameter was always set 0L.
+		 *               and javax.swing.text.JTextComponent always ignore this parameter.
+		 * 
+		 * @return current caret position.
+		 *         if the text is drawn horizontally, width is 0. height is caracter height.
+		 *         if the text is drawn vertically, height is 0. width is caracter width.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getTextLocation(TextHitInfo)
+		 */
+		public Rectangle getTextLocation(TextHitInfo offset)
+		{
+			int line = textArea.getLineOfOffset(textArea.getCaretPosition());
+			int off  = textArea.getCaretPosition() - textArea.getLineStartOffset(line);
+			textArea.offsetToXY(line,off,textArea.returnValue);
+			Rectangle rectangle = new Rectangle(textArea.returnValue.x, 
+				textArea.returnValue.y, 0, fm.getHeight());
+			if(composedString != null)
+				rectangle.translate(composedCaretX, 0);
+
+			Point locationOnScreen = getLocationOnScreen();
+			rectangle.translate(locationOnScreen.x, locationOnScreen.y);
+			Log.log(Log.DEBUG, this, "getTextLocation(" + offset + ")  :: " + rectangle);
+			return rectangle;
+		}
+
+		/**
+		 * caret position to offset.
+		 * position is "absolute position" on screen,
+		 * not "relative position" on componenet.
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @param x absolute position x
+		 * @param y absolute position y
+		 * 
+		 * @return offset from start of composed text.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getTextOffset(int,int)
+		 */
+		public TextHitInfo getLocationOffset(int x, int y)
+		{
+			if(composedString != null)
+			{
+				Point locationOnScreen = getLocationOnScreen();
+				int line   = textArea.getLineOfOffset(textArea.getCaretPosition());
+				int offset = textArea.getCaretPosition() - textArea.getLineStartOffset(line);
+				textArea.offsetToXY(line,offset,textArea.returnValue);
+				x -= locationOnScreen.x + textArea.returnValue.x;
+				y -= locationOnScreen.y + textArea.returnValue.y;
+				if(composedTextLayout.getBounds().contains(x, y))
+				{
+					Log.log(Log.DEBUG, this, "getLocationOffset(" + x + ", " + y + ")  retval :: " + composedTextLayout.hitTestChar(x, y));
+					return composedTextLayout.hitTestChar(x, y);
+				}
+			}
+			Log.log(Log.DEBUG, this, "getLocationOffset(" + x + ", " + y + ")  retval :: null");
+			return null;
+		}
+
+		/**
+		 * get insert position of committed text.
+		 * In most cases, insert position is same as caret position.
+		 * 
+		 * Insert position is used by input method, to examine the text surrounding the insert position.
+		 * the surrounding text is used by some kind of input method, to help the composit.
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @return insert position(equals caret position)
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getInsertPositionOffset()
+		 */
+		public int getInsertPositionOffset()
+		{
+			Log.log(Log.DEBUG, this, "getInsertPositionOffse()  retval :: " + textArea.getCaretPosition());
+			return textArea.getCaretPosition();
+		}
+
+		/**
+		 * get committed text.
+		 * 
+		 * I think, this method is used with getInsertPositionOffset().
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @param beginIndex start offset of committed text.
+		 * @param endIndex   end offset of committed text.
+		 * @param attributes array of attribute related to input method.
+		 *                   this parameter might be null.
+		 *                   javax.swing.text.JTextComponent was always ignore this parameter.
+		 * 
+		 * @return instance of AttributedCharacterIterator,
+		 *         which is contains a part of committed text that specified by beginIndex and endIndex.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getCommittedText(int,int,java.text.AttributedCharacterIterator.Attribute[])
+		 */
+		public AttributedCharacterIterator getCommittedText(int beginIndex,
+			int endIndex, Attribute[] attributes)
+		{
+			String str = textArea.getText(beginIndex, endIndex - beginIndex);
+			Log.log(Log.DEBUG, this, "getCommittedText(" + beginIndex + ", " + endIndex + ", " + attributes + ")  retval :: " + str);
+			return new AttributedString(str).getIterator();
+		}
+
+		/**
+		 * get length of committed text.
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @return length of comitted text.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getCommittedText(int,int,java.text.AttributedCharacterIterator.Attribute[])
+		 */
+		public int getCommittedTextLength()
+		{
+			Log.log(Log.DEBUG, this, "getCommittedTextLength()  retval :: " + textArea.getBufferLength());
+			return textArea.getBufferLength();
+		}
+
+		/**
+		 * get latest committed text, 
+		 * the text was deleted by this component.
+		 * 
+		 * this method is used for undo commit, for some input methods.
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @param attributes array of attribute related to input method.
+		 * 
+		 * @return always null, it means not support undo commit.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#cancelLatestCommittedText(java.text.AttributedCharacterIterator.Attribute[])
+		 */
+		public AttributedCharacterIterator cancelLatestCommittedText(Attribute[] attributes)
+		{
+			Log.log(Log.DEBUG, this, "cancelLatestCommittedText() retval :: " + null);
+			return null;
+		}
+
+		/**
+		 * get the currently selected text. 
+		 * 
+		 * this method is used for reconvert.
+		 * 
+		 * In my experience, this method was never used.
+		 * so this method might not be implemented correctly.
+		 * 
+		 * @param attributes array of attribute related to input method.
+		 *                   this parameter might be null.
+		 *                   javax.swing.text.JTextComponent was always ignore this parameter.
+		 * 
+		 * @return instance of AttributedCharacterIterator,
+		 *         which is contains currently selected text.
+		 *         if there is no active selection, return null.
+		 *         It is not specified by API reference, 
+		 *         but javax.swing.text.JTextComponent was implemented so.
+		 * 
+		 * @see java.awt.im.InputMethodRequest#getSelectedText(java.text.AttributedCharacterIterator.Attribute[])
+		 */
+		public AttributedCharacterIterator getSelectedText(Attribute[] attributes)
+		{
+			Log.log(Log.DEBUG, this, "getSelectedText(" + attributes + ") retval :: " + textArea.getSelectedText());
+			String str = textArea.getSelectedText();
+			if(str != null)
+				return new AttributedString(str).getIterator();
+			else
+				return null;
+		}
+		//}}}
+
+		//{{{ InputMethodListener
+		/**
+		 * composed text was changed.
+		 */
+		public void inputMethodTextChanged(InputMethodEvent evt)
+		{
+			final AttributedCharacterIterator text = evt.getText();
+			final int committed = evt.getCommittedCharacterCount();
+			final int length = text != null 
+				? text.getEndIndex() - text.getBeginIndex() : 0;
+
+			if(0 < length)
+			{
+				//convert to String
+				StringBuffer buf = new StringBuffer();
+				final char DONE = CharacterIterator.DONE;
+				for(char c = text.first(); c != DONE; c = text.next())
+					buf.append(c);
+
+				//commit to buffer
+				if(0 < committed)
+					textArea.getBuffer().insert(
+						textArea.getCaretPosition(), 
+						buf.substring(0, committed));
+
+
+				//composed text
+				if(committed < buf.length())
+				{
+					composedString = buf.substring(committed);
+					composedAttributedString = new AttributedString(
+						text, 
+						text.getBeginIndex() + committed, 
+						text.getEndIndex());
+					composedAttributedString.addAttribute(
+						TextAttribute.FONT, getFont() );
+					composedTextLayout = new TextLayout( 
+						composedAttributedString.getIterator(),
+						fontRenderContext );
+				}
+				else
+					avoidComposedString();
+			}
+			else
+				avoidComposedString();
+
+			//fall through
+			caretPositionChanged(evt);
+		}
+
+		/**
+		 * caret position (in composed text) changed
+		 */
+		public void caretPositionChanged(InputMethodEvent evt)
+		{
+			composedCaret = evt.getCaret();
+			if(composedTextLayout != null)
+			{
+				if(composedCaret != null)
+					composedCaretX = Math.round(
+						composedTextLayout.getCaretInfo(composedCaret)[0]);
+				else
+					composedCaretX = 0;
+
+				int caret = textArea.getCaretPosition();
+				int line  = textArea.getCaretLine();
+				int offset = caret - textArea.getLineStartOffset(line);
+				textArea.offsetToXY(line,offset,textArea.returnValue);
+
+				//composedTextEndX = startX of composed text + composed text width
+				composedTextEndX = 
+					(int)composedTextLayout.getBounds().getWidth();
+				composedTextEndX -= textArea.getHorizontalOffset();
+				composedTextEndX += textArea.returnValue.x;
+				textArea.updateMaxHorizontalScrollWidth();
+
+
+				//it adjusts so that getVisiblePosition() will be visible.
+				TextHitInfo visible = evt.getVisiblePosition();
+				int composedVisibleX;
+				if(visible != null)
+					composedVisibleX = Math.round( 
+						composedTextLayout.getCaretInfo(visible)[0]);
+				else
+					composedVisibleX = composedCaretX;
+
+				int visibleX = textArea.returnValue.x + composedVisibleX;
+				final int fullWidth = textArea.charWidth * 2;
+				final int areaRightX = getWidth() - fullWidth;
+
+				//the visibility of the left edge has priority over the right edge.
+				if(visibleX < 0) 
+				{
+					textArea.setHorizontalOffset(
+						textArea.getHorizontalOffset() 
+						- visibleX);
+					textArea.updateScrollBars();
+				}
+				else if(areaRightX < visibleX)
+				{
+					textArea.setHorizontalOffset(
+						textArea.getHorizontalOffset()
+						- (visibleX - areaRightX));
+					textArea.updateScrollBars();
+				}
+			}
+			else
+			{
+				composedTextEndX = 0;
+			}
+
+			evt.consume();
+			textArea.repaint();
+		}
+		//}}}
+
+		//{{{ other
+		/**
+		 * for JEditTextArea#updateMaxHorizontalScrollWidth()
+		 */
+		public int getComposedTextEndX()
+		{
+			return composedTextEndX;
+		}
+
+		/**
+		 * 
+		 */
+		private void avoidComposedString()
+		{
+			composedString = null;
+			composedAttributedString = null;
+			composedTextLayout = null;
+		}
+		//}}}
+
+	}
+	//}}}
+
 	//}}}
 }
