Skip to content

Commit

Permalink
fix: open diff in new leaf
Browse files Browse the repository at this point in the history
close #306
  • Loading branch information
Vinzent03 committed Sep 15, 2022
1 parent 146c33a commit 6914830
Show file tree
Hide file tree
Showing 6 changed files with 458 additions and 423 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
tab_width = 4
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DiffView from "./ui/diff/diffView";
import { GeneralModal } from "./ui/modals/generalModal";
import { IgnoreModal } from "./ui/modals/ignoreModal";
import GitView from "./ui/sidebar/sidebarView";
import { getNewLeaf } from "./utils";

export default class ObsidianGit extends Plugin {
gitManager: GitManager;
Expand Down Expand Up @@ -130,7 +131,7 @@ export default class ObsidianGit extends Plugin {
id: 'open-diff-view',
name: 'Open diff view',
editorCallback: async (editor, view) => {
this.app.workspace.createLeafBySplit(view.leaf).setViewState({ type: DIFF_VIEW_CONFIG.type, state: { staged: false, file: view.file.path } });
getNewLeaf().setViewState({ type: DIFF_VIEW_CONFIG.type, state: { staged: false, file: view.file.path } });
},
});

Expand Down
Loading

0 comments on commit 6914830

Please sign in to comment.