# HG changeset patch # User wenzelm # Date 1380044474 -7200 # Node ID 8d7029eb0c31def35a7673f74515e37fdfdaf61f # Parent 104a08c2be9ff9e5859d2691bd6198b5fdfbce6d disable standard behaviour of Mac OS X text field (i.e. select-all after focus gain) in order to make completion work more smoothly; diff -r 104a08c2be9f -r 8d7029eb0c31 src/Pure/GUI/gui.scala --- a/src/Pure/GUI/gui.scala Tue Sep 24 18:42:44 2013 +0200 +++ b/src/Pure/GUI/gui.scala Tue Sep 24 19:41:14 2013 +0200 @@ -34,6 +34,9 @@ def init_laf(): Unit = UIManager.setLookAndFeel(get_laf()) + def is_macos_laf(): Boolean = + UIManager.getSystemLookAndFeelClassName() == UIManager.getLookAndFeel.getClass.getName + /* simple dialogs */ diff -r 104a08c2be9f -r 8d7029eb0c31 src/Tools/jEdit/src/completion_popup.scala --- a/src/Tools/jEdit/src/completion_popup.scala Tue Sep 24 18:42:44 2013 +0200 +++ b/src/Tools/jEdit/src/completion_popup.scala Tue Sep 24 19:41:14 2013 +0200 @@ -13,6 +13,7 @@ import java.awt.event.{KeyEvent, MouseEvent, MouseAdapter, FocusAdapter, FocusEvent} import javax.swing.{JPanel, JComponent, JLayeredPane, SwingUtilities} import javax.swing.border.LineBorder +import javax.swing.text.DefaultCaret import scala.swing.{ListView, ScrollPane} import scala.swing.event.MouseClicked @@ -221,6 +222,8 @@ { text_field => + // see https://forums.oracle.com/thread/1361677 + if (GUI.is_macos_laf) text_field.setCaret(new DefaultCaret) private var completion_popup: Option[Completion_Popup] = None