@@ -39,6 +39,8 @@ public void AddCommands()
39
39
CommandHelper . AddCommand ( _mcs , CommitContextCommand , PkgCmdIDList . CommitContext , ActiveDocument_BeforeQueryStatus ) ;
40
40
CommandHelper . AddCommand ( _mcs , RevertContextCommand , PkgCmdIDList . RevertContext , ActiveDocument_BeforeQueryStatus ) ;
41
41
CommandHelper . AddCommand ( _mcs , AddContextCommand , PkgCmdIDList . AddContext , ActiveDocument_BeforeQueryStatus ) ;
42
+ CommandHelper . AddCommand ( _mcs , DeleteContextCommand , PkgCmdIDList . DeleteContext , ActiveDocument_BeforeQueryStatus ) ;
43
+ CommandHelper . AddCommand ( _mcs , DeleteKeepContextCommand , PkgCmdIDList . DeleteKeepContext , ActiveDocument_BeforeQueryStatus ) ;
42
44
CommandHelper . AddCommand ( _mcs , DiffContextCommand , PkgCmdIDList . DiffContext , ActiveDocument_BeforeQueryStatus ) ;
43
45
CommandHelper . AddCommand ( _mcs , PrefDiffContextCommand , PkgCmdIDList . PrefDiffContext , ActiveDocument_BeforeQueryStatus ) ;
44
46
}
@@ -105,6 +107,22 @@ private void AddContextCommand(object sender, EventArgs e)
105
107
_dte . ActiveDocument . Save ( ) ;
106
108
ProcessHelper . StartTortoiseGitProc ( _envHelper , $ "/command:add /path:\" { currentFilePath } \" ") ;
107
109
}
110
+ private void DeleteContextCommand ( object sender , EventArgs e )
111
+ {
112
+ var currentFilePath = _dte . ActiveDocument . FullName ;
113
+ if ( string . IsNullOrEmpty ( currentFilePath ) ) return ;
114
+ if ( ! _dte . ActiveDocument . Saved )
115
+ _dte . ActiveDocument . Save ( ) ;
116
+ ProcessHelper . StartTortoiseGitProc ( _envHelper , $ "/command:remove /path:\" { currentFilePath } \" ") ;
117
+ }
118
+ private void DeleteKeepContextCommand ( object sender , EventArgs e )
119
+ {
120
+ var currentFilePath = _dte . ActiveDocument . FullName ;
121
+ if ( string . IsNullOrEmpty ( currentFilePath ) ) return ;
122
+ if ( ! _dte . ActiveDocument . Saved )
123
+ _dte . ActiveDocument . Save ( ) ;
124
+ ProcessHelper . StartTortoiseGitProc ( _envHelper , $ "/command:remove /keep /path:\" { currentFilePath } \" ") ;
125
+ }
108
126
private void FetchContextCommand ( object sender , EventArgs e )
109
127
{
110
128
var currentFilePath = _dte . ActiveDocument . FullName ;
0 commit comments