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

PR: Restore widget shortcuts to Preferences and allow to change them on the fly (Shortcuts) #23024

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Nov 23, 2024

  1. API: Improve docstrings of SpyderShortcutsMixin

    The current docstrings were not easy to understand.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    bcbf1e2 View commit details
    Browse the repository at this point in the history
  2. Shortcuts: Use a dataclass to represent shortcut data

    - The previous solution, which used tuples to collect those data, was
    easy to break, because it required to put data in the right order; and
    undocumented, because it was unclear what kind of data had to be added
    in the tuple elements.
    - Those limitations made difficult to reason about shortcuts-related
    code.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    474c185 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    029dfdd View commit details
    Browse the repository at this point in the history
  4. API: Allow to add callables to observe an option in our config system

    - Before we only allowed class methods decorated with on_conf_change to
    do that.
    - But that's too limited if we need to use regular functions to observe
    an option. And that's precisely what this new method allows us to do.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    38b3211 View commit details
    Browse the repository at this point in the history
  5. Config: Notify when a shortcut is changed in our config system

    This is necessary to add observers for specific shortcuts.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    b41b593 View commit details
    Browse the repository at this point in the history
  6. API: Add an observer for each shortcut registered for a widget

    - That allows those shortcuts to be updated on the fly when they are
    changed in Preferences or directly with set_conf.
    - Also, fix inheritance of classes that inherit from
    SpyderShortcutsMixin to accomodate this change.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    235587e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d9f5374 View commit details
    Browse the repository at this point in the history
  8. Testing: Remove setting CONF_SECTION for EditorStack/EditorSplitter

    That was introducing an error in test_shortcut_for_widget_is_updated
    when run on CI due to the incorrectly named section.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    a924b4a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    70cd666 View commit details
    Browse the repository at this point in the history
  10. API: Add plugin_name kwarg to register_shortcut_for_widget

    This is to have feature parity of kwargs with the other methods of
    SpyderShortcutsMixin.
    ccordoba12 committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    8257479 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2024

  1. Shortcuts: Move SHORTCUTS_FOR_WIDGETS_DATA to its plugin and make it …

    …public
    
    That's because it's going to be used in other places, so it's not good
    to leave it as private in our API.
    ccordoba12 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    1f336d9 View commit details
    Browse the repository at this point in the history