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

Plugin crashes Spyder v6 #52

Open
schmoelder opened this issue Sep 4, 2024 · 5 comments
Open

Plugin crashes Spyder v6 #52

schmoelder opened this issue Sep 4, 2024 · 5 comments

Comments

@schmoelder
Copy link

When starting spyder v6, I get the following error message:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QWidget::setLayout: Attempting to set QLayout "" on StatusBarVimWidget "", which already has a layout
<class 'spyder_okvim.spyder.plugin.OkVim'>: 'Editor' object has no attribute 'editorsplitter'
Traceback (most recent call last):
  File "/home/jo/software/miniforge3/envs/dev/lib/python3.11/site-packages/spyder/app/mainwindow.py", line 761, in setup
    plugin_instance = PLUGIN_REGISTRY.register_plugin(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jo/software/miniforge3/envs/dev/lib/python3.11/site-packages/spyder/api/plugin_registration/registry.py", line 344, in register_plugin
    instance = self._instantiate_spyder5_plugin(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jo/software/miniforge3/envs/dev/lib/python3.11/site-packages/spyder/api/plugin_registration/registry.py", line 195, in _instantiate_spyder5_plugin
    plugin_instance.initialize()
  File "/home/jo/software/miniforge3/envs/dev/lib/python3.11/site-packages/spyder/api/plugins/new_api.py", line 708, in initialize
    self.on_initialize()
  File "/home/jo/software/miniforge3/envs/dev/lib/python3.11/site-packages/spyder_okvim/spyder/plugin.py", line 140, in on_initialize
    vim_cmd.editor_widget.editorsplitter,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Editor' object has no attribute 'editorsplitter'
[1]    222767 segmentation fault (core dumped)  spyder
@schmoelder
Copy link
Author

It appears the crash comes from these lines

https://github.com/ok97465/spyder_okvim/blob/af9467a4393d2b696fda95b6c6845ecdc8c104a7/spyder_okvim/spyder/plugin.py#L138C1-L143C53

If I change them to the following:

        sc = QShortcut(
            QKeySequence("Esc"),
            vim_cmd.editor_widget.get_widget().editorsplitter,
            vim_cmd.commandline.setFocus,
        )
        sc.setContext(Qt.WidgetWithChildrenShortcut)

Spyder does not crash anymore, the (empty) pane shows but the plugin does not work yet.

@ok97465
Copy link
Owner

ok97465 commented Sep 9, 2024

Sorry for the late response.
My plugin doesn't seem to work with Spyder6 yet.
I'll take my time looking into it this weekend.

@schmoelder
Copy link
Author

Thanks mate, I would really appreciate it! Let me know if I can be of help! 🤓

@schmoelder
Copy link
Author

Anything I can do to help? I'd also be willing to sponsor this plugin with 25 €.

@ok97465
Copy link
Owner

ok97465 commented Oct 2, 2024

Anything I can do to help? I'd also be willing to sponsor this plugin with 25 €.

Thank you so much for your interest in my plugin.
I want to solve the problem quickly, but things aren't going well at work, so it's difficult to find personal time. I'm sorry.

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

No branches or pull requests

2 participants