File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -325,18 +325,24 @@ export default class LinterPlugin extends Plugin {
325325 saveCommandDefinition . checkCallback = ( checking : boolean ) => {
326326 this . originalSaveCallback ( checking ) ;
327327
328- if ( this . settings . lintOnSave && this . isEnabled ) {
329- const editor = this . getEditor ( ) ;
330- if ( editor ) {
331- const file = this . app . workspace . getActiveFile ( ) ;
332- if ( ! this . shouldIgnoreFile ( file ) && this . isMarkdownFile ( file ) && editor . cm ) {
333- if ( ! checking ) {
328+ const editor = this . getEditor ( ) ;
329+ const file = this . app . workspace . getActiveFile ( ) ;
330+
331+ if ( checking ) {
332+ if ( editor && file ) {
333+ return true ;
334+ }
335+ } else {
336+ if ( this . settings . lintOnSave && this . isEnabled ) {
337+ if ( editor ) {
338+ if ( ! this . shouldIgnoreFile ( file ) && this . isMarkdownFile ( file ) && editor . cm ) {
334339 void this . runLinterEditor ( editor ) ;
335340 }
336- return true ;
337341 }
338342 }
339343 }
344+
345+
340346 } ;
341347 }
342348
You can’t perform that action at this time.
0 commit comments