]> gitweb.factorcode.org Git - factor.git/commitdiff
HOME key in listener a bit more useful
authorSlava Pestov <slava@factorcode.org>
Fri, 3 Sep 2004 19:12:45 +0000 (19:12 +0000)
committerSlava Pestov <slava@factorcode.org>
Fri, 3 Sep 2004 19:12:45 +0000 (19:12 +0000)
TODO.FACTOR.txt
factor/listener/FactorListener.java

index 6508c2527cd203a49eb1a086a7b69b21e58f61a5..5bb69abb7557e7d0786f7136fd1c2861f10141b6 100644 (file)
@@ -3,15 +3,12 @@
 - nicer way to combine two paths\r
 - -1.1 3 ^ shouldn't give a complex number\r
 - don't show listener on certain commands\r
-- inferior hangs\r
 - plugin should not exit jEdit on fatal errors\r
 - IN: format base: work with all types of numbers\r
-- home key in the listener\r
 - wordpreview: don't show for string literals and comments\r
 - eliminate usage of long long\r
 - 64 bit support\r
 - alist -vs- assoc terminology\r
-- minimize stage2 initialization code, just move it to source files\r
 - clean up listener's action popups\r
 - jedit ==> jedit-word, jedit takes a file name\r
 - introduce ifte* and ?str-head/?str-tail where appropriate\r
index f0c4cf9645d5228624a091e94e38426650edd3e6..62685a8735c416571bb3fdda950e0e876c17bbea 100644 (file)
@@ -65,16 +65,21 @@ public class FactorListener extends JTextPane
 
                listenerList = new EventListenerList();
 
+               InputMap inputMap = getInputMap();
+               
                /* Replace enter to evaluate the input */
-               getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
+               inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
                        new EnterAction());
 
                /* Replace backspace to stop backspacing over the prompt */
-               getInputMap().put(KeyStroke.getKeyStroke('\b'),
+               inputMap.put(KeyStroke.getKeyStroke('\b'),
                        new BackspaceAction());
 
+               inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME,0),
+                       new HomeAction());
+
                /* Workaround */
-               getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE,0),
+               inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE,0),
                        new DummyAction());
        } //}}}
 
@@ -323,6 +328,15 @@ public class FactorListener extends JTextPane
                }
        } //}}}
 
+       //{{{ BackspaceAction class
+       class BackspaceAction extends AbstractAction
+       {
+               public void actionPerformed(ActionEvent evt)
+               {
+                       setCaretPosition(limit);
+               }
+       } //}}}
+
        //{{{ DummyAction class
        class DummyAction extends AbstractAction
        {