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

Cannot save changes made in diff view #35

Closed
Olatunji-Longe opened this issue Feb 13, 2017 · 4 comments · Fixed by #38
Closed

Cannot save changes made in diff view #35

Olatunji-Longe opened this issue Feb 13, 2017 · 4 comments · Fixed by #38

Comments

@Olatunji-Longe
Copy link

Olatunji-Longe commented Feb 13, 2017

Cannot save changes made in diff view. This issue has been closed in 2015, but still exixts even in 2017. Why was it closed?

@Olatunji-Longe Olatunji-Longe changed the title Cannot save from diff view Cannot save changes made in diff view Feb 13, 2017
@M4TH76
Copy link

M4TH76 commented Apr 4, 2017

Add on line 158 of main.js:

MainViewManager.setActivePaneId(panes[0])
var document = DocumentManager.getCurrentDocument()
document.setText(compareView.editor().getValue())

it will copy the modified content to the left pane document

@mnishig
Copy link
Contributor

mnishig commented May 3, 2017

In my installation is not line 158, M4TH76's patch put to line 156 after else { ,
and run perfectly with following patch.

--- main.js	2017-05-04 00:18:12.000000000 +0900
+++ main.js.fix	2017-05-04 00:18:34.000000000 +0900
@@ -153,11 +153,15 @@
           compareEditor.css("height", editorCurrentHeight + "px");
           hdiff = compareEditor.parent().height() - editorCurrentHeight;
         } else {
+          MainViewManager.setActivePaneId(panes[0]);
+          var document = DocumentManager.getCurrentDocument();
+          document.setText(compareView.editor().getValue()); 
+          
           comparePanel.hide();
           target.innerHTML = "";
           compareView = null;
-          editor.removeClass("hide");
-          WorkspaceManager.off(WorkspaceManager.EVENT_WORKSPACE_UPDATE_LAYOUT, onWorkspaceLayoutUpdate);
+          editor.removeClass("hide");    
+        WorkspaceManager.off(WorkspaceManager.EVENT_WORKSPACE_UPDATE_LAYOUT, onWorkspaceLayoutUpdate);
           Sidebar.show();
         }
       });

mnishig pushed a commit to mnishig/brackets-compare that referenced this issue May 4, 2017
@jthomae1
Copy link

I can confirm the same behaviour, changes I made in the diff view are not saved when I leave the view.

@bomsy bomsy closed this as completed in #38 Nov 14, 2017
bomsy added a commit that referenced this issue Nov 14, 2017
fix #35 Cannot save changes made in diff view
@nlourenco
Copy link

Commit not reflected in recent download from Brackets Extension manager. Can confirm @mnishig solution, but must save and close & re-open Brackets.

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 a pull request may close this issue.

5 participants