Skip to content

Commit f36ab91

Browse files
authored
Merge pull request #1315 from kdnk/master
fix(obsidian-1.9.0): use checkCallback instead of callback
2 parents fcc918a + d57c493 commit f36ab91

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

manifest-beta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "obsidian-linter",
33
"name": "Linter",
44
"version": "1.29.0",
5-
"minAppVersion": "1.5.7",
5+
"minAppVersion": "1.9.0",
66
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
77
"author": "Victor Tao",
88
"authorUrl": "https://github.com/platers",

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "obsidian-linter",
33
"name": "Linter",
44
"version": "1.29.0",
5-
"minAppVersion": "1.5.7",
5+
"minAppVersion": "1.9.0",
66
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
77
"author": "Victor Tao",
88
"authorUrl": "https://github.com/platers",

src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export default class LinterPlugin extends Plugin {
114114
const saveCommandDefinition = this.app.commands?.commands?.[
115115
'editor:save-file'
116116
];
117-
if (saveCommandDefinition && saveCommandDefinition.callback && this.originalSaveCallback) {
118-
saveCommandDefinition.callback = this.originalSaveCallback;
117+
if (saveCommandDefinition && saveCommandDefinition.checkCallback && this.originalSaveCallback) {
118+
saveCommandDefinition.checkCallback = this.originalSaveCallback;
119119
}
120120
}
121121

@@ -319,10 +319,10 @@ export default class LinterPlugin extends Plugin {
319319
'editor:save-file'
320320
];
321321

322-
this.originalSaveCallback = saveCommandDefinition?.callback;
322+
this.originalSaveCallback = saveCommandDefinition?.checkCallback;
323323

324324
if (typeof this.originalSaveCallback === 'function') {
325-
saveCommandDefinition.callback = () => {
325+
saveCommandDefinition.checkCallback = () => {
326326
this.originalSaveCallback();
327327

328328
if (this.settings.lintOnSave && this.isEnabled) {

0 commit comments

Comments
 (0)