New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toggle on/off #23
Conversation
} | ||
} | ||
|
||
disable() { | ||
this.enabled = false; | ||
if (this.isLegacy) { | ||
if (this.isLegacy()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug from original code — this is always truthy
"@types/node": "^16.11.6", | ||
"@typescript-eslint/eslint-plugin": "^5.2.0", | ||
"@typescript-eslint/parser": "^5.2.0", | ||
"builtin-modules": "^3.2.0", | ||
"esbuild": "0.13.12", | ||
"obsidian": "^0.12.17", | ||
"obsidian": "1.4.11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating this removes some type errors
"@codemirror/state": "^6.2.0", | ||
"@codemirror/view": "^6.2.0", | ||
"@codemirror/language": "^6.6.0" | ||
"typescript": "^5.3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could not build using TS 4.4.4
@@ -28,15 +44,19 @@ export default class RelativeLineNumbers extends Plugin { | |||
if (this.isLegacy()) { | |||
this.legacyEnable(); | |||
} else { | |||
// @ts-ignore | |||
this.registerEditorExtension(lineNumbersRelative()); | |||
this.editorExtension.length = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this follows code style from these guidelines https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Change+or+reconfigure+editor+extensions
Nice, thanks for this |
Closes #2