-
-
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: Fix unable to split editor #5083
Merged
ccordoba12
merged 6 commits into
spyder-ide:master
from
jnsebgosselin:fix_unable_to_split_editor
Sep 7, 2017
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f8a83cc
Fix first error that prevented to split the Editor
jnsebgosselin 3955986
Fix second error in the Outline explorer
jnsebgosselin 0e40e26
Revert "Fix second error in the Outline explorer"
jnsebgosselin 4c84067
Changed where editors are removed from the outline editor
jnsebgosselin 54b9c2b
Fix error when closing panel when last focus is None
jnsebgosselin cbc5551
Remove comment since it should now works as expected
jnsebgosselin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1238,7 +1238,7 @@ def register_editorstack(self, editorstack): | |
self.set_last_focus_editorstack(self, editorstack) | ||
editorstack.set_closable( len(self.editorstacks) > 1 ) | ||
if self.outlineexplorer is not None: | ||
editorstack.set_outlineexplorer(self.outlineexplorer) | ||
editorstack.set_outlineexplorer(self.outlineexplorer.explorer) | ||
editorstack.set_find_widget(self.find_widget) | ||
editorstack.reset_statusbar.connect(self.readwrite_status.hide) | ||
editorstack.reset_statusbar.connect(self.encoding_status.hide) | ||
|
@@ -1472,13 +1472,15 @@ def get_filename_index(self, filename): | |
def get_current_editorstack(self, editorwindow=None): | ||
if self.editorstacks is not None: | ||
if len(self.editorstacks) == 1: | ||
return self.editorstacks[0] | ||
editorstack = self.editorstacks[0] | ||
else: | ||
editorstack = self.__get_focus_editorstack() | ||
if editorstack is None or editorwindow is not None: | ||
return self.get_last_focus_editorstack(editorwindow) | ||
return editorstack | ||
|
||
editorstack = self.get_last_focus_editorstack(editorwindow) | ||
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. Fix Issue 3 |
||
if editorstack is None: | ||
editorstack = self.editorstacks[0] | ||
return editorstack | ||
|
||
def get_current_editor(self): | ||
editorstack = self.get_current_editorstack() | ||
if editorstack is not None: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -746,6 +746,12 @@ def add_corner_widgets_to_tabbar(self, widgets): | |
def closeEvent(self, event): | ||
self.threadmanager.close_all_threads() | ||
self.analysis_timer.timeout.disconnect(self.analyze_script) | ||
|
||
# Remove editor references from the outline explorer settings | ||
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. Fix Issue 2 |
||
if self.outlineexplorer is not None: | ||
for finfo in self.data: | ||
self.outlineexplorer.remove_editor(finfo.editor) | ||
|
||
QWidget.closeEvent(self, event) | ||
if is_pyqt46: | ||
self.destroyed.emit() | ||
|
@@ -2012,10 +2018,6 @@ def create_new_editor(self, fname, enc, txt, set_current, new=False, | |
editor.zoom_out.connect(lambda: self.zoom_out.emit()) | ||
editor.zoom_reset.connect(lambda: self.zoom_reset.emit()) | ||
editor.sig_eol_chars_changed.connect(lambda eol_chars: self.refresh_eol_chars(eol_chars)) | ||
if self.outlineexplorer is not None: | ||
# Removing editor reference from outline explorer settings: | ||
editor.destroyed.connect(lambda obj=editor: | ||
self.outlineexplorer.remove_editor(obj)) | ||
|
||
self.find_widget.set_editor(editor) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix Issue 1
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.
This was my bad in a refactoring I did some months ago. Thanks for catching it.