Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to vertically split window #4705

Closed
AnwariasEu opened this issue Jul 5, 2017 · 6 comments · Fixed by #5083
Closed

Unable to vertically split window #4705

AnwariasEu opened this issue Jul 5, 2017 · 6 comments · Fixed by #5083

Comments

@AnwariasEu
Copy link

Description

What steps will reproduce the problem?

  1. Open Project
  2. Open one python file from the project
  3. Try to split the code windows vertically

What is the expected output? What do you see instead?
Vertically split window with new window was expected.
UI did not change, error was thrown.

Please provide any additional information below

File "/usr/lib/python3.6/site-packages/spyder/widgets/editor.py", line 2244, in
File "/usr/lib/python3.6/site-packages/spyder/widgets/editor.py", line 2303, in split
File "/usr/lib/python3.6/site-packages/spyder/widgets/editor.py", line 2237, in init
File "/usr/lib/python3.6/site-packages/spyder/plugins/editor.py", line 1235, in register_editorstack
File "/usr/lib/python3.6/site-packages/spyder/widgets/editor.py", line 844, in set_outlineexplorer

Version and main components

  • Spyder Version: 4.0.0.dev0
  • Python Version: 3.6.1
  • Qt Versions: 5.9.1, PyQt5 5.8.2 on Linux

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  None (NOK)
numpy >=1.7      :  1.13.0 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
psutil >=0.3     :  5.2.1 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
sympy >=0.7.3    :  None (NOK)
cython >=0.21    :  None (NOK)
qtconsole >=4.2.0:  4.3.0 (OK)
pylint >=0.25    :  1.7.2 (OK)

@ccordoba12
Copy link
Member

Thanks for reporting. We'll fix this for beta1.

@jnsebgosselin
Copy link
Member

jnsebgosselin commented Aug 28, 2017

@ccordoba12 I think I'm able to reproduce this, either by splitting vertically or horizontally, with a project opened or not. Here is the full traceback:

Traceback (most recent call last):
File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 2274, in
lambda: self.split(orientation=Qt.Vertical))
File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 2335, in split
unregister_editorstack_cb=self.unregister_editorstack_cb)
File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 2269, in init
self.register_editorstack_cb(self.editorstack)
File "C:\Users\jsgosselin\spyder\spyder\plugins\editor.py", line 1241, in register_editorstack
editorstack.set_outlineexplorer(self.outlineexplorer)
File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 847, in set_outlineexplorer
self.outlineexplorer.is_visible.connect(self._refresh_outlineexplorer)
AttributeError: 'OutlineExplorer' object has no attribute 'is_visible'

Versions and main components

  • Spyder Version: 4.0.0.dev0
  • Python Version: 3.6.1
  • Qt Version: 5.9.1
  • PyQt Version: 5.9
  • Operating system: Windows 7 64 bits

Dependencies

IPython >=4.0 : 6.1.0 (OK)
cython >=0.21 : 0.25.2 (OK)
jedi >=0.9.0 : 0.10.2 (OK)
nbconvert >=4.0 : 5.2.1 (OK)
numpy >=1.7 : 1.13.0 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.1 (OK)
qtconsole >=4.2.0: 4.4.0.dev (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.6.2 (OK)
sympy >=0.7.3 : None (NOK)

image

@ccordoba12
Copy link
Member

@jnsebgosselin, since you can reproduce it, would you mind to take a look at this one?

@jnsebgosselin
Copy link
Member

Yes, I'll work on this one and I'll also write a test.

@jnsebgosselin jnsebgosselin self-assigned this Aug 29, 2017
@jnsebgosselin
Copy link
Member

ok, I think the problem comes from line 1241:

editorstack.set_outlineexplorer(self.outlineexplorer)

we should read instead:

editorstack.set_outlineexplorer(self.outlineexplorer.explorer)

and the reason is given here on line 545:

# Pass the OutlineExplorer widget to the stacks because they
# don't need the plugin
editorstack.set_outlineexplorer(self.outlineexplorer.explorer)

This solve the issue for me. If anyone else can confirm this, I'll do a PR. Meanwhile, I'll write a test.

@jnsebgosselin
Copy link
Member

jnsebgosselin commented Aug 29, 2017

I'm now able to correctly split vertically and horizontally the Editor, but if I click on an item in the outline explorer when I'm in the newly created editor panel (not the original one), I get the following traceback:

Traceback (most recent call last):
File "C:\Users\jsgosselin\spyder\spyder\widgets\editortools.py", line 491, in clicked
self.activated(item)
File "C:\Users\jsgosselin\spyder\spyder\widgets\editortools.py", line 482, in activated
if _id == editor_id and editor.parent() is parent:
RuntimeError: wrapped C/C++ object of type CodeEditor has been deleted

But it seems like just a harmless bug since everything seems to work as expected. Moreover, I think it is a known issue since there is a comment on line 480 stating that it is not working anymore:

if i_item is root_item:
    #XXX: not working anymore!!!
    for editor, _id in list(self.editor_ids.items()):
        if _id == editor_id and editor.parent() is parent:
            self.current_editor = editor
            break
    break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants