Skip to content

Commit

Permalink
Removes default hotkey combo and bumps version to 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
akaalias committed Mar 3, 2021
1 parent 11e9b4d commit f320d58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,9 @@ export default class MyPlugin extends Plugin {
id: 'insert-footnote',
name: 'Insert Footnote',
checkCallback: (checking: boolean) => {
if (checking) {
return !!this.app.workspace.getActiveViewOfType(MarkdownView);
}

if (checking) return !!this.app.workspace.getActiveViewOfType(MarkdownView);
this.insertFootnote();
},
hotkeys: [
{
modifiers: ["Command", "Shift"],
key: "6",
}]
}
});
}

Expand All @@ -35,7 +27,7 @@ export default class MyPlugin extends Plugin {
let markdownText = mdView.data;

// check if we're in a footnote detail line ("[^1]: footnote")
// if so, jump cursor back to original line if we have a previous jumping-off point
// if so, jump cursor back to the footnote in the text
let detailLineRegex = /\[\^(\d+)\]\:/;
const cursorPosition = editor.getCursor();
let lineText = editor.getLine(cursorPosition.line);
Expand All @@ -47,7 +39,7 @@ export default class MyPlugin extends Plugin {
let footnote = s.replace(":", "");

let returnLineIndex = cursorPosition.line;
// find the first line where this footnote exists in the text
// find the FIRST OCCURENCE where this footnote exists in the text
for(let i = 0; i < doc.lineCount(); i++) {
let scanLine = doc.getLine(i);
if(scanLine.contains(footnote)) {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "obsidian-footnotes",
"name": "Footnote Shortcut",
"version": "0.0.5",
"version": "0.0.6",
"minAppVersion": "0.9.12",
"description": "Insert and write a new footnote faster",
"description": "Insert and write footnotes faster",
"author": "Alexis Rondeau",
"authorUrl": "https://publish.obsidian.md/alexisrondeau",
"isDesktopOnly": false
Expand Down

0 comments on commit f320d58

Please sign in to comment.