File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ export default class CreateNoteModal extends Modal {
164
164
let leaf = this . app . workspace . getLeaf ( false ) ;
165
165
if ( this . mode === NewFileLocation . NewPane ) {
166
166
leaf = this . app . workspace . splitLeafOrActive ( ) ;
167
+ } else if ( this . mode === NewFileLocation . NewTab ) {
168
+ leaf = this . app . workspace . getLeaf ( true ) ;
167
169
} else if ( ! leaf ) {
168
170
// default for active pane
169
171
leaf = this . app . workspace . getLeaf ( true ) ;
Original file line number Diff line number Diff line change 1
1
export enum NewFileLocation {
2
2
CurrentPane = 'current-pane' ,
3
3
NewPane = 'new-pane' ,
4
+ NewTab = 'new-tab' ,
4
5
}
Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ export default class AdvancedNewFilePlugin extends Plugin {
21
21
new ChooseFolderModal ( this . app , NewFileLocation . NewPane ) . open ( ) ;
22
22
} ,
23
23
} ) ;
24
+
25
+ this . addCommand ( {
26
+ id : 'advanced-new-file-new-tab' ,
27
+ name : 'Create note in a new tab' ,
28
+ callback : ( ) => {
29
+ new ChooseFolderModal ( this . app , NewFileLocation . NewTab ) . open ( ) ;
30
+ } ,
31
+ } ) ;
24
32
}
25
33
26
34
onunload ( ) {
You can’t perform that action at this time.
0 commit comments