This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
Split View (Same Document) #11820
Merged
Merged
Split View (Same Document) #11820
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ffa298c
Opening same document in multiple full editors
swmitra aca3614
Removing Commented blocks of code
swmitra b1251ce
JSLint and JSHint warning removal
swmitra 51a1799
MRU list corruption fix
swmitra 1571821
Split view shortcuts to target panes
swmitra b56124d
Working set sync behavior change.
swmitra ea226b3
Fix for character duplication.
swmitra e4f5298
Script error fix.
swmitra d854d0e
Undo/Redo bug fix reported by @abose.
swmitra 594974f
Updating existing unit test and adding a new test case to check multi…
swmitra 3eecee4
Fix for File content corruption while closing a dirty file.
swmitra 1e613cf
Merge branch 'master' of https://github.com/adobe/brackets into swmit…
swmitra cc13c7f
Pane context extraction.
swmitra 0cc50ee
Pane marking shouldn't happen on custom views
swmitra 072ccaa
Fix for 'dirtyFlagChange' handler leak
swmitra ebcd796
Bug fix for split view with flip view
swmitra File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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 |
---|---|---|
|
@@ -83,6 +83,11 @@ define(function (require, exports, module) { | |
|
||
EventDispatcher.makeEventDispatcher(Document.prototype); | ||
|
||
/** | ||
* list of editors who were initialized as master editors for this doc. | ||
*/ | ||
Document.prototype._associatedFullEditors = []; | ||
|
||
/** | ||
* Number of clients who want this Document to stay alive. The Document is listed in | ||
* DocumentManager._openDocuments whenever refCount > 0. | ||
|
@@ -196,12 +201,15 @@ define(function (require, exports, module) { | |
*/ | ||
Document.prototype._makeEditable = function (masterEditor) { | ||
if (this._masterEditor) { | ||
console.error("Document is already editable"); | ||
} else { | ||
this._text = null; | ||
this._masterEditor = masterEditor; | ||
masterEditor.on("change", this._handleEditorChange.bind(this)); | ||
//Already a master editor is associated , so preserve the old editor in list of full editors | ||
if(this._associatedFullEditors.indexOf(this._masterEditor) < 0){ | ||
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. You need to use Brackets with JSLint enabled when contributing to Brackets. Please re-check your code. In this specific case, there's a space missing between |
||
this._associatedFullEditors.push(this._masterEditor); | ||
} | ||
} | ||
|
||
this._text = null; | ||
this._masterEditor = masterEditor; | ||
masterEditor.on("change", this._handleEditorChange.bind(this)); | ||
}; | ||
|
||
/** | ||
|
@@ -215,7 +223,31 @@ define(function (require, exports, module) { | |
} else { | ||
// _text represents the raw text, so fetch without normalized line endings | ||
this._text = this.getText(true); | ||
this._masterEditor = null; | ||
this._associatedFullEditors.splice(this._associatedFullEditors.indexOf(this._masterEditor),1); | ||
|
||
//Identify the most recently created full editor before this and set that as new master editor | ||
if(this._associatedFullEditors.length > 0){ | ||
this._masterEditor = this._associatedFullEditors[this._associatedFullEditors.length - 1]; | ||
} else { | ||
this._masterEditor = null; | ||
} | ||
} | ||
}; | ||
|
||
/** | ||
* Toggles the master editor from a pool of full editors which has gained focus | ||
* To be used internally by Editor only | ||
*/ | ||
Document.prototype._toggleMasterEditor = function (masterEditor) { | ||
//Do a check before processing the request to ensure inline editors are not being set as master editor | ||
if(this._associatedFullEditors.indexOf(masterEditor) >= 0){ | ||
if (this._masterEditor) { | ||
//Already a master editor is associated , so preserve the old editor in list of editors | ||
if(this._associatedFullEditors.indexOf(this._masterEditor) < 0){ | ||
this._associatedFullEditors.push(this._masterEditor); | ||
} | ||
} | ||
this._masterEditor = masterEditor; | ||
} | ||
}; | ||
|
||
|
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 |
---|---|---|
|
@@ -961,6 +961,7 @@ define(function (require, exports, module) { | |
this._codeMirror.on("focus", function () { | ||
self._focused = true; | ||
self.trigger("focus", self); | ||
self.document._toggleMasterEditor(self);//Added to toggle fulleditors as master editor | ||
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. Nit: missing space after |
||
}); | ||
|
||
this._codeMirror.on("blur", function () { | ||
|
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
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
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.
Nit: First letter of the first word in a sentence should be capitalized.