Right to left languages such as Arabic and Farsi, possibly mixed with numbers and English expressions, are not currently well supported in IDEA text editors. Typing a right to left sentence such as این یک جمله راست به چپ است should stop the cursor at the left side until the language is switched back to a left to right one.
This is a serious usability problem for IDEA, especially when editing multilingual HTML files.
This topic (named BIDI) is discussed for Swing in:
http://java.sun.com/javase/6/docs/technotes/guides/2d/spec/j2d-fonts.html
For a sample BIDI java file see the attachment. Try selecting the Farsi sentence from left to right in IDEA to see what's wrong.