Skip to content

Commit

Permalink
fix: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Creling committed Aug 4, 2021
1 parent b1e07c8 commit 5c7c9ed
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ export default class ActivityLogger extends Plugin {

this.app.workspace.onLayoutReady(() => {

this.registerEvent(this.app.vault.on('modify', params => {
this.saveItem(params.path, "modifiedFiles")
}));
this.registerEvent(this.app.vault.on('modify', params => {
this.saveItem(params.path, "modifiedFiles")
}));

this.registerEvent(this.app.vault.on('delete', params => {
this.saveItem(params.path, "deletedFiles")
}));

this.registerEvent(this.app.vault.on('create', (params) => {
this.registerEvent(this.app.vault.on('create', (params) => {
console.log("create", params.path)
this.saveItem(params.path, "createdFiles")
}));
this.saveItem(params.path, "createdFiles")
}));

})

Expand Down Expand Up @@ -191,10 +191,10 @@ export default class ActivityLogger extends Plugin {
*/
dealWithTemplates(template: string, type: string): string {
const filePaths = this.data[type]
const filenamePlaceHolderRegex = this.regexs[type]
const result = filenamePlaceHolderRegex.exec(template)
if (result) {
const filenamePlaceHolder = result[0]
const filenamePlaceHolderRegex = this.regexs[type]
const result = filenamePlaceHolderRegex.exec(template)
if (result) {
const filenamePlaceHolder = result[0]
if (filePaths.length) {
const fileCount = filePaths.length
template = template.replace(filenamePlaceHolder, filenamePlaceHolder.repeat(fileCount))
Expand Down

0 comments on commit 5c7c9ed

Please sign in to comment.