-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Add function/class search shortcut, menu and toolbar entries #3878
Changes from 4 commits
e2051bd
318a9d3
57ac0f1
e8ae93b
c668115
08ead8e
28a20c3
388e7b1
df9d53e
684b3fa
dc5e91f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,7 +318,8 @@ _/debug step into = Ctrl+F11 | |
_/fullscreen mode = F11 | ||
editor/toggle comment = Ctrl+1 | ||
editor/go to definition = Ctrl+G | ||
editor/show/hide project explorer = Ctrl+Alt+P | ||
editor/show/hide project explorer = Ctrl+Alt+J | ||
_/symbol finder = Ctrl+Alt+P | ||
_/debug step return = Ctrl+Shift+F11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ccordoba12 I thought we were supposed to not touch these files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry! I thought that file should be modified because a default shortcut was altered and a new one was introduced in this PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, should I remove those edits? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep |
||
editor/new file = Ctrl+N | ||
_/debug step over = Ctrl+F10 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -651,6 +651,14 @@ def get_plugin_actions(self): | |
self.register_shortcut(self.file_switcher_action, context="_", | ||
name="File switcher", add_sc_to_tip=True) | ||
|
||
self.symbol_finder_action = create_action(self, _('Symbol finder...'), | ||
icon=ima.icon('symbol_find'), | ||
tip=_('Fast symbol search in file'), | ||
triggered=self.call_symbol_finder, | ||
context=Qt.ApplicationShortcut) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not saying you should change this, just a comment for reference. # I tend to favor this one for several reasons.
# It can be automatically performed and enforced by tools like yapf
# it results in more lines of code but ir more readable as each line corresponds
# to a parameter
self.symbol_finder_action = create_action(
self,
_('Symbol finder...'),
icon=ima.icon('symbol_find'),
tip=_('Fast symbol search in file'),
triggered=self.call_symbol_finder,
context=Qt.ApplicationShortcut)
# or
self.symbol_finder_action = create_action(self,
_('Symbol finder...'),
icon=ima.icon('symbol_find'),
tip=_('Fast symbol search in file'),
triggered=self.call_symbol_finder,
context=Qt.ApplicationShortcut) |
||
self.register_shortcut(self.symbol_finder_action, context="_", | ||
name="symbol finder", add_sc_to_tip=True) | ||
|
||
self.revert_action = create_action(self, _("&Revert"), | ||
icon=ima.icon('revert'), tip=_("Revert file from disk"), | ||
triggered=self.revert) | ||
|
@@ -995,6 +1003,7 @@ def get_plugin_actions(self): | |
self.save_all_action, | ||
save_as_action, | ||
self.file_switcher_action, | ||
self.symbol_finder_action, | ||
self.revert_action, | ||
MENU_SEPARATOR, | ||
print_preview_action, | ||
|
@@ -1007,7 +1016,8 @@ def get_plugin_actions(self): | |
self.main.file_menu_actions += file_menu_actions | ||
file_toolbar_actions = [self.new_action, self.open_action, | ||
self.save_action, self.save_all_action, | ||
self.file_switcher_action] | ||
self.file_switcher_action, | ||
self.symbol_finder_action] | ||
self.main.file_toolbar_actions += file_toolbar_actions | ||
|
||
# ---- Find menu/toolbar construction ---- | ||
|
@@ -1725,6 +1735,11 @@ def call_file_switcher(self): | |
if self.editorstacks: | ||
self.get_current_editorstack().open_fileswitcher_dlg() | ||
|
||
@Slot() | ||
def call_symbol_finder(self): | ||
if self.editorstacks: | ||
self.get_current_editorstack().open_symbolfinder_dlg() | ||
|
||
def update_recent_file_menu(self): | ||
"""Update recent file menu""" | ||
recent_files = [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this shortcut is no more needed because
@goanpeca, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then @andfoy please remove this shortcut as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind that much about the shortcut, but I don't expect the Project explorer to be visible all the time. I actually close the Project explorer when working on my laptop because the screen is not big enough, and I find it pretty annoying that it always comes back when I launch Spyder. Even on my desktop screen, which is big enough, I don't find the Project explorer particularly useful - I only use it when opening files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the Project Explorer can be closed at any time, so it's not enforced on users. It's just a visual clue that you're working on a project.
Please submit a PR to fix that. I don't have a problem with it :-)