Skip to content

Commit

Permalink
fix: fix the error of opening the mindmap on the markdown file and .g…
Browse files Browse the repository at this point in the history
…itignore
  • Loading branch information
wangtianlun committed May 9, 2019
1 parent 4260765 commit 4b33bc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"activationEvents": [
"onLanguage:xmind",
"onLanguage:km",
"onLanguage:md",
"onCommand:extension.mindmap"
],
"main": "./out/extension",
Expand All @@ -43,15 +42,6 @@
"XMIND",
"xmind"
]
},
{
"id": "markdown",
"extensions": [
".md"
],
"aliases": [
"md"
]
}
],
"commands": [
Expand Down
6 changes: 4 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import * as path from 'path';
import * as fs from 'fs';
import { resourceSchema } from './constant';
import { Xmind, Img } from './services';
const matchableFileTypes: string[] = ['xmind', 'km', 'git'];
const matchableFileTypes: string[] = ['xmind', 'km'];

// type ProcessService = Xmind | Markdown;

export function activate(context: vscode.ExtensionContext) {
const openedPanelMap = new Map<string, boolean | undefined | null>();
Expand Down Expand Up @@ -35,13 +37,13 @@ export function activate(context: vscode.ExtensionContext) {
const extName = path.extname(fileName);
const xmindService = new Xmind(fileName);
const imgService = new Img();
const panel = createWebviewPanel(basename);
const importData = getImportData(fileName, extName, xmindService) || '{}';

if (!matchableFileTypes.includes(extName.slice(1))) {
return;
}

const panel = createWebviewPanel(basename);
panel.webview.html = html;
panel.webview.onDidReceiveMessage(
message => {
Expand Down

0 comments on commit 4b33bc0

Please sign in to comment.