Repository: spyder-ide/spyder

Issue:
Drag and drop from OS file explorer is not working
## No drag & drop / no function linking

**What steps will reproduce the problem?**
1. conda install -c spyder-ide spyder==3.0.0b4
2. open Spyder
3. try drag&drop a file from Windows explorer into the editor
4. inside any file, CTRL+mounseclick on a function to jump to its definiton

**What is the expected output? What do you see instead?**

for (3): file is not loaded in the editor
for (4): the jump to the definition doe not occur

**Please provide any additional information below**
## Versions and main components
- Spyder Version: see above, 3.0.0beta
- Python Version: 3.5
- Operating system: Windows 7
## Dependencies

```
jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.1 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.2.3 (OK)
pygments >=2.0   :  2.1.3 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.3.1 (OK)
sympy >=0.7.3    :  1.0 (OK)
```



Discussion:
Thanks for reporting this problem. I noticed it too and I don't know when this stopped to work ;-)

We'll fix it for beta5.

I just saw you scipy talk. Man, you guys rock! Virtual environment management in spyder. Keep up your good work & spirit!

Thanks!


Resolving patch:
diff --git a/spyderlib/plugins/editor.py b/spyderlib/plugins/editor.py
--- a/spyderlib/plugins/editor.py
+++ b/spyderlib/plugins/editor.py
@@ -1253,6 +1253,7 @@ def register_editorstack(self, editorstack):
         editorstack.save_breakpoints.connect(self.save_breakpoints)
         editorstack.text_changed_at.connect(self.text_changed_at)
         editorstack.current_file_changed.connect(self.current_file_changed)
+        editorstack.plugin_load.connect(self.load)
         editorstack.plugin_load[()].connect(self.load)
         editorstack.edit_goto.connect(self.load)
         editorstack.sig_save_as.connect(self.save_as)
diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py
--- a/spyderlib/widgets/editor.py
+++ b/spyderlib/widgets/editor.py
@@ -1868,15 +1868,12 @@ def dragEnterEvent(self, event):
         # The second check is necessary on Windows, where source.hasUrls()
         # can return True but source.urls() is []
         if source.hasUrls() and source.urls():
-            if mimedata2url(source, extlist=get_edit_extensions()):
+            all_urls = mimedata2url(source)
+            text = [encoding.is_text_file(url) for url in all_urls]
+            if any(text):
                 event.acceptProposedAction()
             else:
-                all_urls = mimedata2url(source)
-                text = [encoding.is_text_file(url) for url in all_urls]
-                if any(text):
-                    event.acceptProposedAction()
-                else:
-                    event.ignore()
+                event.ignore()
         elif source.hasText():
             event.acceptProposedAction()
         elif os.name == 'nt':
@@ -1895,8 +1892,7 @@ def dropEvent(self, event):
         if source.hasUrls():
             files = mimedata2url(source)
             files = [f for f in files if encoding.is_text_file(f)]
-            supported_files = mimedata2url(source, extlist=get_edit_extensions())
-            files = set(files or []) | set(supported_files or [])
+            files = set(files or [])
             for fname in files:
                 self.plugin_load.emit(fname)
         elif source.hasText():


Test patch: