Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31519/src/org/python/pydev/editor
Modified Files:
PyEdit.java
Log Message:
<li>Fixed NPE when creating editor with no interpreter configured</li>
<li>Hyperlink works in the same way that F3 (saves file before search)</li>
<li>Fixed problem while navigating pydev package explorer ( https://sourceforge.net/tracker/index.php?func=detail&aid=2008015&group_id=85796&atid=577329 )</li>
<li>Applied patch that fixes race condition in PythonNature (thanks to Radim Kubacki)</li>
<li><strong>Eclipse 3.4</strong>: Move / rename working</li>
Index: PyEdit.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v
retrieving revision 1.131
retrieving revision 1.132
diff -C2 -d -r1.131 -r1.132
*** PyEdit.java 28 Jun 2008 13:29:19 -0000 1.131
--- PyEdit.java 31 Jul 2008 01:47:36 -0000 1.132
***************
*** 1124,1127 ****
--- 1124,1128 ----
}
+
/**
* @return the python nature associated with this editor.
***************
*** 1133,1148 ****
}
IPythonNature pythonNature = PythonNature.getPythonNature(project);
! if(pythonNature == null){
! Tuple<SystemPythonNature, String> infoForFile = PydevPlugin.getInfoForFile(getEditorFile());
! if(infoForFile == null){
! NotConfiguredInterpreterException e = new NotConfiguredInterpreterException();
! ErrorDialog.openError(PyAction.getShell(),
! "Error: no interpreter configured", "Interpreter not configured\n(Please, Configure it under window->preferences->PyDev)",
! PydevPlugin.makeStatus(IStatus.ERROR, e.getMessage(), e));
! throw e;
!
! }
! pythonNature = infoForFile.o1;
}
return pythonNature;
}
--- 1134,1158 ----
}
IPythonNature pythonNature = PythonNature.getPythonNature(project);
! if(pythonNature != null){
! return pythonNature;
}
+
+ //if it's an external file, there's the possibility that it won't be added even here.
+ pythonNature = PythonNature.addNature(this.getEditorInput());
+
+ if(pythonNature != null){
+ return pythonNature;
+ }
+
+ Tuple<SystemPythonNature, String> infoForFile = PydevPlugin.getInfoForFile(getEditorFile());
+ if(infoForFile == null){
+ NotConfiguredInterpreterException e = new NotConfiguredInterpreterException();
+ ErrorDialog.openError(PyAction.getShell(),
+ "Error: no interpreter configured", "Interpreter not configured\n(Please, Configure it under window->preferences->PyDev)",
+ PydevPlugin.makeStatus(IStatus.ERROR, e.getMessage(), e));
+ throw e;
+
+ }
+ pythonNature = infoForFile.o1;
return pythonNature;
}
|