File tree Expand file tree Collapse file tree 7 files changed +23
-0
lines changed Expand file tree Collapse file tree 7 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ Set logging level for extension
73
73
74
74
- ` gitWorktree.worktree.loggingLevel ` : Info
75
75
76
+ Should we close prompts when user loses focus
77
+
78
+ - ` gitWorktree.worktree.closeInputOnBlur ` : True
79
+
76
80
### Clone Settings
77
81
78
82
Set the name of the folder the bare repository contents will be push into
Original file line number Diff line number Diff line change 101
101
" Warn logging level" ,
102
102
" Info logging level"
103
103
]
104
+ },
105
+ "gitWorktree.worktree.closeInputOnBlur" : {
106
+ "type" : " boolean" ,
107
+ "default" : true ,
108
+ "description" : " Should we close input automatically when a user switches focus"
104
109
}
105
110
}
106
111
},
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export const add = async () => {
45
45
[ createWorktreeOption , ...filteredBranches ] ,
46
46
{
47
47
placeHolder : 'Create new worktree or select remote branch' ,
48
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
48
49
}
49
50
) ;
50
51
if ( ! branch )
@@ -68,6 +69,7 @@ export const add = async () => {
68
69
69
70
let trackingBranch = await window . showQuickPick ( remoteBranches , {
70
71
placeHolder : 'Select remote branch to track' ,
72
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
71
73
} ) ;
72
74
73
75
worktree = await addNewWorktree ( newBranch , trackingBranch ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export const clone = async () => {
18
18
const cloneUrl = await window . showInputBox ( {
19
19
placeHolder : 'Git repository url' ,
20
20
prompt : 'Please enter a valid url to clone' ,
21
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
21
22
} ) ;
22
23
if ( ! cloneUrl )
23
24
return showUserMessage ( 'Warn' , 'Aborted as no url was given' ) ;
@@ -40,6 +41,7 @@ export const clone = async () => {
40
41
const newRepoName = await window . showInputBox ( {
41
42
placeHolder : 'Repository name' ,
42
43
prompt : 'Enter new name for repository' ,
44
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
43
45
value : repoName ,
44
46
validateInput : async ( value ) => {
45
47
const text = value ?. trim ( ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ const openOnClone = getVSCodeSetting(
21
21
noYesWindowOptions . yes
22
22
) ;
23
23
24
+ const shouldCloseOnBlur = getVSCodeSetting (
25
+ 'gitWorktree.worktree.closeInputOnBlur' ,
26
+ true
27
+ ) ;
28
+
24
29
// Project
25
30
const shouldOpenOnProject = getVSCodeSetting (
26
31
'gitWorktree.worktree.openOnProject' ,
@@ -79,6 +84,7 @@ const shouldRemoveMultiple = getVSCodeSetting(
79
84
export default {
80
85
shouldPushBranchAutomatically,
81
86
loggingLevel,
87
+ shouldCloseOnBlur,
82
88
83
89
// Clone
84
90
cloneBaseDirectory,
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ export const getUniqueWorktreeName = async ({
91
91
return window . showInputBox ( {
92
92
placeHolder,
93
93
prompt,
94
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
94
95
value,
95
96
validateInput : async ( value ) => {
96
97
const text = value ?. trim ( ) ;
Original file line number Diff line number Diff line change 1
1
import type { IWorktree } from '#/@types/worktree' ;
2
+ import settings from '#/src/config/settings' ;
2
3
import { window } from 'vscode' ;
3
4
4
5
export const selectWorktree = async < T extends boolean = false > (
@@ -20,6 +21,7 @@ export const selectWorktree = async <T extends boolean = false>(
20
21
const worktree = await window . showQuickPick ( items , {
21
22
matchOnDetail : true ,
22
23
canPickMany,
24
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
23
25
} ) ;
24
26
25
27
if ( ! worktree ) return ;
@@ -30,6 +32,7 @@ export const selectWorktree = async <T extends boolean = false>(
30
32
const worktree = await window . showQuickPick ( items , {
31
33
matchOnDetail : true ,
32
34
canPickMany,
35
+ ignoreFocusOut : settings . shouldCloseOnBlur ,
33
36
} ) ;
34
37
35
38
if ( ! worktree ) return ;
You can’t perform that action at this time.
0 commit comments