File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 34
34
"protocol_onedrive_connect_fail" : " Something went wrong from response from OneDrive. Maybe you rejected the auth?" ,
35
35
"protocol_onedrive_connect_unknown" : " Do not know how to deal with the callback: {{params}}" ,
36
36
37
- "command_startsync" : " start sync" ,
37
+ "command_startsync" : " start sync the folder" ,
38
+ "command_startsync_file" : " start sync current file" ,
38
39
"command_forcesync" : " Force full synchronization" ,
39
40
"command_drynrun" : " start sync (dry run only)" ,
40
41
"command_exportsyncplans_json" : " export sync plans in json format" ,
Original file line number Diff line number Diff line change 34
34
"protocol_onedrive_connect_fail" : " OneDrive 的回调请求有点异常。您是否拒绝了鉴权?" ,
35
35
"protocol_onedrive_connect_unknown" : " 不知道如何处理此 callback:{{params}}" ,
36
36
37
- "command_startsync" : " 开始同步(start sync)" ,
37
+ "command_startsync" : " 开始同步文件夹" ,
38
+ "command_startsync_file" : " 开始同步当前文件" ,
38
39
"command_forcesync" : " 强制全量同步" ,
39
- "command_drynrun" : " 开始同步(空跑模式)(start sync (dry run only)) " ,
40
+ "command_drynrun" : " 开始同步(空跑模式)" ,
40
41
"command_exportsyncplans_json" : " 导出同步计划为 json 格式(export sync plans in json format)" ,
41
42
"command_exportsyncplans_table" : " 导出同步计划为表格格式(export sync plans in table format)" ,
42
43
"command_exportlogsindb" : " 从数据库导出终端日志(export logs saved in db)" ,
Original file line number Diff line number Diff line change 34
34
"protocol_onedrive_connect_fail" : " OneDrive 的回撥請求有點異常。您是否拒絕了鑑權?" ,
35
35
"protocol_onedrive_connect_unknown" : " 不知道如何處理此 callback:{{params}}" ,
36
36
37
- "command_startsync" : " 開始同步(start sync)" ,
37
+ "command_startsync" : " 开始同步文件夹" ,
38
+ "command_startsync_file" : " 开始同步当前文件" ,
38
39
"command_forcesync" : " 强制全量同步" ,
39
- "command_drynrun" : " 開始同步 (空跑模式)(start sync (dry run only) )" ,
40
+ "command_drynrun" : " 开始同步 (空跑模式)" ,
40
41
"command_exportsyncplans_json" : " 匯出同步計劃為 json 格式(export sync plans in json format)" ,
41
42
"command_exportsyncplans_table" : " 匯出同步計劃為表格格式(export sync plans in table format)" ,
42
43
"command_exportlogsindb" : " 從資料庫匯出終端日誌(export logs saved in db)" ,
Original file line number Diff line number Diff line change @@ -831,6 +831,20 @@ export default class InvioPlugin extends Plugin {
831
831
async ( ) => this . syncRun ( "manual" )
832
832
) ;
833
833
834
+ this . addCommand ( {
835
+ id : "start-sync-file" ,
836
+ name : t ( "command_startsync_file" ) ,
837
+ icon : iconNameSyncLogo ,
838
+ callback : async ( ) => {
839
+ const activeFile = this . app . workspace . getActiveFile ( ) ;
840
+ log . info ( 'active file: ' , activeFile ) ;
841
+ if ( activeFile instanceof TFile ) {
842
+ this . syncRun ( "manual" , [ activeFile . path ] ) ;
843
+ } else {
844
+ new Notice ( `File not found` ) ;
845
+ }
846
+ } ,
847
+ } ) ;
834
848
this . addCommand ( {
835
849
id : "start-sync" ,
836
850
name : t ( "command_startsync" ) ,
You can’t perform that action at this time.
0 commit comments