Skip to content

Commit

Permalink
fix: 1.匹配到emmet的情况才禁用Tab默认事件,避免Tab的正常功能受到影响
Browse files Browse the repository at this point in the history
  • Loading branch information
JuckZ committed Apr 21, 2023
1 parent c9fdb55 commit 68c3cdb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,15 @@ export default class AwesomeBrainManagerPlugin extends Plugin {
if (triggerText === 't') {
const targetText = '- [ ] ';
EditorUtils.replaceCurrentSelection(editor, targetText);
event.preventDefault();
}
const tableConfig = triggerText.match(/^t(\d+)\*(\d+)/);
if (tableConfig) {
const targetText = generateMarkdownTable(tableConfig[1], tableConfig[2]);
EditorUtils.replaceCurrentSelection(editor, targetText);
event.preventDefault();
}
}
event.preventDefault();
}
};
// window.addEventListener('languagechange', () => {
Expand Down

0 comments on commit 68c3cdb

Please sign in to comment.