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

Add keyboard shortcuts to context menu in editor #3294

Merged
merged 3 commits into from
Jul 20, 2016

Conversation

jitseniesen
Copy link
Member

Before:
contextmenu-before

After:
contextmenu-after

@jitseniesen
Copy link
Member Author

The second commit (b131781) is something that looked wrong, but as far as I know it does not make a difference, and I don't really understand what's going on.

@goanpeca
Copy link
Member

Sweet 👍, let me test on Mac and Win ;-)

@ccordoba12 ccordoba12 added this to the v3.0rc1 milestone Jul 15, 2016
@Nodd
Copy link
Contributor

Nodd commented Jul 19, 2016

The indentation for all create_action calls doesn't follow pep8 at all, it may be a good time to correct it.

@goanpeca
Copy link
Member

@Nodd, you mean like:

    def setup_context_menu(self):
        """Setup context menu"""
        self.undo_action = create_action(
            self,
            _("Undo"),
            icon=ima.icon('undo'),
            shortcut=get_shortcut('editor', 'undo'), 
            triggered=self.undo,
            )

@jitseniesen
Copy link
Member Author

As I read pep8, you can also write

    def setup_context_menu(self):
        """Setup context menu"""
        self.undo_action = create_action(
            self, _("Undo"), icon=ima.icon('undo'),
            shortcut=get_shortcut('editor', 'undo'), triggered=self.undo)

But I guess most important is to be consistent as it looks annoyingly messy otherwise.

Anyway, I will make the change.

@Nodd
Copy link
Contributor

Nodd commented Jul 19, 2016

Yes, either this or align after the opened parenthesis:

    def setup_context_menu(self):
        """Setup context menu"""
        self.undo_action = create_action(self, _("Undo"),
                                         icon=ima.icon('undo'),
                                         shortcut=get_shortcut('editor', 'undo'), 
                                         triggered=self.undo,
                                         )

But I think the lines will be too long.

@goanpeca
Copy link
Member

Yes @Nodd, that's why I think about that option (it is too long)

@ccordoba12 ccordoba12 closed this Jul 20, 2016
@ccordoba12 ccordoba12 reopened this Jul 20, 2016
@ccordoba12
Copy link
Member

Thanks @jitseniesen, this looks good to me ;-)

Note: The failure in our tests is related to CircleCI, whose support is unfinished. I stopped it for now to avoid further errors. I'll restart again after 3.0 is released.

@ccordoba12 ccordoba12 merged commit 1362127 into spyder-ide:master Jul 20, 2016
@jitseniesen jitseniesen deleted the add-shortcuts branch July 26, 2016 10:06
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

Successfully merging this pull request may close these issues.

4 participants