Changeset 335

Show
Ignore:
Timestamp:
09/11/08 13:23:14 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Fixed bug #58: auto-completed in read mode
  • Option "Use Ctrl+Enter" now has no effect on read mode - Hitting Enter always sends results to lisp.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/LispConfiguration.java

    r325 r335  
    6060        } 
    6161    }; 
     62 
     63    public void stopContentAssistant(){ 
     64        ca.enableAutoActivation(false); 
     65    } 
     66     
     67    /* returns to state defined in AUTO_POPUP_COMPLETIONS) */ 
     68    public void startContentAssistant(){ 
     69        ca.enableAutoActivation(LispPlugin.getDefault().getPreferenceStore() 
     70                        .getBoolean(PreferenceConstants.AUTO_POPUP_COMPLETIONS)); 
     71    } 
    6272     
    6373        public LispConfiguration(ILispEditor editor, ColorManager colorManager) { 
  • jasko.tim.lisp/src/jasko/tim/lisp/views/ReplView.java

    r327 r335  
    5858        protected ReplHistory history; 
    5959        protected ReplEditor in; 
     60        protected LispConfiguration inconfig; 
    6061         
    6162        protected Composite parentControl; 
     
    6768        protected Button btn; 
    6869        protected Label replPackage; 
     70        private boolean inReadMode; 
    6971         
    7072        private boolean replInited = false; 
     
    371373                comp2.setLayout(layout); 
    372374                 
    373                 in = new ReplEditor(comp2, new VerticalRuler(10), SWT.V_SCROLL | SWT.MULTI | SWT.LEFT | SWT.BORDER); 
     375                in = new ReplEditor(comp2, new VerticalRuler(10), 
     376                                SWT.V_SCROLL | SWT.MULTI | SWT.LEFT | SWT.BORDER); 
     377                inconfig = in.config; 
     378                inReadMode = false; 
    374379                 
    375380                in.getControl().setLayoutData(gd); 
     
    898903                                appendText(swank.fetchDisplayText() + "\n"); 
    899904                                scrollDown(); 
     905                                inReadMode = false; 
    900906                        } 
    901907                }); 
     
    10651071                public void verifyKey(VerifyEvent event) { 
    10661072                        boolean ctrl = true; 
    1067                         if( LispPlugin.getDefault().getPreferenceStore() 
     1073                        if( !inReadMode && LispPlugin.getDefault().getPreferenceStore() 
    10681074                                .getBoolean(PreferenceConstants.USE_CTRL_ENTER) ){ 
    10691075                                ctrl = event.stateMask == SWT.CONTROL;  
     
    11801186         
    11811187        protected void pushReadState(String s1, String s2) { 
     1188                inReadMode = true; 
     1189                inconfig.stopContentAssistant(); 
    11821190                ReplView.switchToRepl(); 
    11831191                pushState(new ReadState(s1, s2)); 
     
    12321240                        appendInput(">> " + command); 
    12331241                        scrollDown(); 
     1242                        inconfig.startContentAssistant(); 
    12341243                        return true; 
    12351244                } 
     
    12411250        } 
    12421251         
    1243          
    1244          
    1245          
    1246          
     1252 
    12471253 
    12481254        protected class DebugState implements State,