added action isabelle.complete, using standard jEdit keyboard shortcut;
authorwenzelm
Thu Aug 29 21:49:46 2013 +0200 (2013-08-29 ago)
changeset 53293fd27b8f5a479
parent 53292 f567c1c7b180
child 53294 814eee60e1b1
added action isabelle.complete, using standard jEdit keyboard shortcut;
NEWS
src/Tools/jEdit/src/actions.xml
src/Tools/jEdit/src/completion_popup.scala
src/Tools/jEdit/src/isabelle.scala
src/Tools/jEdit/src/jEdit.props
     1.1 --- a/NEWS	Thu Aug 29 21:17:46 2013 +0200
     1.2 +++ b/NEWS	Thu Aug 29 21:49:46 2013 +0200
     1.3 @@ -96,6 +96,9 @@
     1.4  completed in backslash forms, e.g. \forall or \<forall> that both
     1.5  produce the Isabelle symbol \<forall> in its Unicode rendering.
     1.6  
     1.7 +* Standard jEdit completion via C+b uses action isabelle.complete
     1.8 +with fall-back on complete-word for non-Isabelle buffers.
     1.9 +
    1.10  * Improved support for Linux look-and-feel "GTK+", see also "Utilities
    1.11  / Global Options / Appearance".
    1.12  
     2.1 --- a/src/Tools/jEdit/src/actions.xml	Thu Aug 29 21:17:46 2013 +0200
     2.2 +++ b/src/Tools/jEdit/src/actions.xml	Thu Aug 29 21:49:46 2013 +0200
     2.3 @@ -117,6 +117,11 @@
     2.4  	    isabelle.jedit.Isabelle.decrease_font_size(view);
     2.5  	  </CODE>
     2.6  	</ACTION>
     2.7 +	<ACTION NAME="isabelle.complete">
     2.8 +	  <CODE>
     2.9 +	    isabelle.jedit.Isabelle.complete(view);
    2.10 +	  </CODE>
    2.11 +	</ACTION>
    2.12  	<ACTION NAME="isabelle.control-sub">
    2.13  	  <CODE>
    2.14  	    isabelle.jedit.Isabelle.control_sub(textArea);
     3.1 --- a/src/Tools/jEdit/src/completion_popup.scala	Thu Aug 29 21:17:46 2013 +0200
     3.2 +++ b/src/Tools/jEdit/src/completion_popup.scala	Thu Aug 29 21:49:46 2013 +0200
     3.3 @@ -155,10 +155,6 @@
     3.4            else input_delay.invoke()
     3.5          }
     3.6        }
     3.7 -      else {
     3.8 -        dismissed()
     3.9 -        input_delay.revoke()
    3.10 -      }
    3.11      }
    3.12  
    3.13      private val input_delay =
     4.1 --- a/src/Tools/jEdit/src/isabelle.scala	Thu Aug 29 21:17:46 2013 +0200
     4.2 +++ b/src/Tools/jEdit/src/isabelle.scala	Thu Aug 29 21:49:46 2013 +0200
     4.3 @@ -11,7 +11,7 @@
     4.4  
     4.5  import org.gjt.sp.jedit.{jEdit, View, Buffer}
     4.6  import org.gjt.sp.jedit.textarea.JEditTextArea
     4.7 -import org.gjt.sp.jedit.gui.DockableWindowManager
     4.8 +import org.gjt.sp.jedit.gui.{DockableWindowManager, CompleteWord}
     4.9  
    4.10  
    4.11  object Isabelle
    4.12 @@ -163,6 +163,17 @@
    4.13    }
    4.14  
    4.15  
    4.16 +  /* completion */
    4.17 +
    4.18 +  def complete(view: View)
    4.19 +  {
    4.20 +    Completion_Popup.Text_Area(view.getTextArea) match {
    4.21 +      case Some(text_area_completion) => text_area_completion.action(true)
    4.22 +      case None => CompleteWord.completeWord(view)
    4.23 +    }
    4.24 +  }
    4.25 +
    4.26 +
    4.27    /* control styles */
    4.28  
    4.29    def control_sub(text_area: JEditTextArea)
     5.1 --- a/src/Tools/jEdit/src/jEdit.props	Thu Aug 29 21:17:46 2013 +0200
     5.2 +++ b/src/Tools/jEdit/src/jEdit.props	Thu Aug 29 21:49:46 2013 +0200
     5.3 @@ -190,6 +190,8 @@
     5.4  isabelle-sledgehammer.dock-position=bottom
     5.5  isabelle-symbols.dock-position=bottom
     5.6  isabelle-theories.dock-position=right
     5.7 +isabelle.complete.label=Complete text
     5.8 +isabelle.complete.shortcut=C+b
     5.9  isabelle.control-bold.label=Control bold
    5.10  isabelle.control-bold.shortcut=C+e RIGHT
    5.11  isabelle.control-reset.label=Control reset