-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
@swmitra Thanks for this PR. Very nice addition to Brackets! @marcelgerber @zaggino @sprintr @petetnt @peterflynn Could you guys take some time in reviewing this? |
Tagging @abose |
@swmitra Please fix the JSHint errors. |
Began reviewing this against the current master 40ad8e9 Most recently used
|
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 comment
The 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 if
and (
which JSLint would complain about.
|
@zaggino yeah, I explained that pretty badly as I was in a bit of a hurry and might have jumped into conclusions as linting the same file without any extensions enabled (with JSLint) seems to work fine, but doing the same while using But you are correct, it doesn't have anything to do with ESLint itself, my bad. I've updated the post. |
More issues: De-synchronized files
Working set behaviorWorking set should be synchronized too: if a file gets modified (is marked dirty) in pane 2 and is open in pane 1, it should appear in both working sets. After closing a file, the pane states that it is still the same file but shows the contents of the other fileHaven't been able to repeat this in a repeatable manner, but sometimes when closing files that are duplicated, pane text and the contents of the file don't match. Might be related to the working set behavior. Saving the file in this state brings tons of unsuspected behaviors. |
Cleaned up JSLint and JSHint warnings from the change set.
+1 I hope you merge this soon =] |
@brenovieira Sure! Sorting out few issues with the changes. |
MRU list corruption fix Suppress File Save Dialog when a dirty file is open in other panes apart from the pane requested
@zaggino @petetnt Updated the PR with MRU List fix. |
@swmitra seems to be working with my feature now 👍 I did run into that de-syncronized issue described here: #11820 (comment) again Also found a new bug:
|
@petetnt To me it seems like expected as undo/redo stack should be in sync. If I am missing something here please let me know. I have tried to reproduce de-synchronized issue but it's intermittent. Looks like change listner is getting registered multiple times. I am looking into this and push the required changes soon. |
@swmitra Check out this screenshot flow if it's any help (redo and undo stack work as expected, the error is in the working set): Write in the first panel Write in the second panel Press CTRL+Z / Undo when second panel is still active (you might need to do it a few times, it doesn't always trigger for me): Not sure if it would make sense that the working sets would be in sync with each other altogether: if |
Adding support to open a document in FIRST pane or SECOND pane irrespective of active pane. Cmd-Alt + Left Click to open a file in SECOND pane , Cmd + Left click to open a file in FIRST pane. TODO : Shortcut to open a file in both the panes
Just took a look at this, sorry for the delay. I didn't do a ton of testing, but so far it looks great and is a very nice addition. Open question on the shortcuts: Should we use Left Pane/Right Pane instead of First Pane/Second Pane? I suppose the latter scales better for if/when we get multiple splits. |
@petetnt Finally I have modified the working set behavior in two use cases.
|
There is one pending issue, if the same doc is open in both panes, after doing some edits, if you do undo till the start state, the document will not get |
There are two pending issues @abose @nethip @petetnt -
I am working on both of these and hopefully today we can resolve both these issues and probably good to go for a merge. |
@petetnt Silly me :-( . Fixed now by handling custom views. Need to do some more unit testing on this area though. |
@swmitra thanks for the quick fix! |
@swmitra Just now, after getting the |
@petetnt Fixed the possible memory leak issue. Found two new problems(?) while testing with the flip feature.
This might be an issue with the integration of both these features , but please have a look to identify any obvious pointer which I would have missed during debugging. |
@petetnt I have fixed the second problem mentioned in my earlier post. It was happening because paneId was not being sent as part of command data while invoking FILE_CLOSE. Included the pane info now. |
@swmitra I think the first issue should be fixed by checking if the current file is in the working set before triggering I think that might be an error in the original implementation too, not directly related to integration itself |
How is this feature used? I can't find any documentation and am not sure how to view a file in both panes in 1.6. |
@depiction Open Split View and open a file to the first pane. Then focus the other pane and open the same file again (from the file tree). You should now see the same file on both panes. |
@petetnt Thanks. |
Hi, how can I disable this feature? Unfortunately it's very unusual for me |
It's an explicit feature. You can always choose not to have the same doc on both the panes. |
To be honest it confused me too (at first) a lot before getting used to it (and now I quite enjoy it 😸) Not sure how hard it would be to add a preference to it though. At best it would be just checking which pane to open on (if the file is already open). |
@swmitra When I choose a document to edit from working directory (double-click) it automatically opens in active pane. I prefer I my workspase to keep different file types in different panes, so it will be great to enable and disable this feature when needed |
Works terrifically! A tip for devs with many files in the File Tree and find it frustrating to find where the file is to open in the other panel: First make sure the panel you want to open the file in as well - that it's active or in focus. Then right click the file at the top left panel (rather than the File Tree), then go to "Show in Finder" (on Mac or whatever equivalent on Windows). Open the file from there. It should open in the active panel! Now you have two panels editing the same file. |
I saw a single post above asking this question but no real answer. Is there any way to disable this "feature"? I personally do not like it as it constantly takes files that are already open in one pane and then opens them in the other pane when clicking tabs. This is insanely annoying and disrupts my workflow. |
This feature enables users of Brackets to open same document in both the editor panes and also enables extension developers to create full editors for documents under different containers to make full use of the code hinting features already available for Brackets.
For more details about the feature , please refer to https://trello.com/c/GezHZcCx/390-m-split-view-same-document#
Feature Details
Implementation
The core idea of this implementation is to handle 'masterEditor' tied to a document instance. 'Document' in the new implementation maintains a list of full editors and exposes private API to switch between full editors as master editor. Full editors who are tied to the document , marks itself as master editor when focused.
Pending Tasks