Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 2d1eb5d

Browse files
WliuWliu
authored andcommitted
Add a new setting for list of grammars to automatically preview
1 parent 3a58a66 commit 2d1eb5d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/main.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports =
8484
@destroyedItems.clear()
8585
return unless openPreview
8686

87-
grammars = atom.config.get('markdown-preview.grammars') ? []
87+
grammars = atom.config.get('markdown-preview.automaticPreviewGrammars') ? []
8888
return unless editor.getGrammar().scopeName in grammars
8989

9090
@addPreviewForEditor(editor, atom.workspace.paneForItem(item))

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@
7878
"text.plain.null-grammar"
7979
],
8080
"description": "List of scopes for languages for which previewing is enabled. See [this README](https://github.com/atom/spell-check#spell-check-package-) for more information on finding the correct scope for a specific language."
81+
},
82+
"automaticPreviewGrammars": {
83+
"type": "array",
84+
"order": 8,
85+
"default": [
86+
"source.gfm",
87+
"source.litcoffee"
88+
],
89+
"description": "Only automatically open previews for the given list of scopes."
8190
}
8291
}
8392
}

0 commit comments

Comments
 (0)