Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentVoid13 committed Nov 8, 2020
1 parent 7445a00 commit f10d9b5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion INTERNAL_COMMAND_TEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Thanks for considering contributing to [Templater](https://github.com/SilentVoid13/Templater) !

Developing a new internal command template is almost the same process as developing a [INTERNAL_TEMPLATES](https://github.com/SilentVoid13/Templater/blob/master/INTERNAL_TEMPLATES.md).
Developing a new internal command template is almost the same process as developing an [Internal Template](https://github.com/SilentVoid13/Templater/blob/master/INTERNAL_TEMPLATES.md).

The only differences are the following:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The right input field defines the system command that will be run. The output of

##### Internal Command Templates

You can also use some Internal command templates inside your commands. The template patterns will be replaced before your command gets executed.
You can also use some Internal command templates inside your commands. The command template will be replaced before your command gets executed.

I invite everyone to contribute to this plugin development by adding new internal command templates. (Check [INTERNAL_COMMAND_TEMPLATES](https://github.com/SilentVoid13/Templater/blob/master/INTERNAL_COMMAND_TEMPLATES.md) for more informations).

Expand Down
2 changes: 1 addition & 1 deletion src/internal_command_templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function note_title(app: App): Promise<string> {

async function note_content(app: App): Promise<string> {
let activeLeaf = app.workspace.activeLeaf;
if (!(activeLeaf && activeLeaf.view instanceof MarkdownView)) {
if (!(activeLeaf) || !(activeLeaf.view instanceof MarkdownView)) {
throw new Error("activeLeaf.view is not an instance of MarkdownView")
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class TemplaterPlugin extends Plugin {
let content = await this.app.vault.read(file);

let activeLeaf = this.app.workspace.activeLeaf;
if (!(activeLeaf && activeLeaf.view instanceof MarkdownView)) {
if (!(activeLeaf) || !(activeLeaf.view instanceof MarkdownView)) {
return;
}

Expand Down

0 comments on commit f10d9b5

Please sign in to comment.