(plugin: HiNotePluginContext, highlight: HiNote)
| 67 | } |
| 68 | |
| 69 | function createCommentWidget(plugin: HiNotePluginContext, highlight: HiNote): Decoration { |
| 70 | return Decoration.widget({ |
| 71 | widget: new CommentWidget( |
| 72 | plugin, |
| 73 | highlight, |
| 74 | () => { |
| 75 | void CommentWidgetHelper.openCommentPanel(plugin.app, highlight, plugin.eventManager); |
| 76 | } |
| 77 | ), |
| 78 | side: 2, |
| 79 | stopEvent: (event: Event) => event.type === 'mousedown' || event.type === 'mouseup' |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | function shouldShowCommentWidget(plugin: HiNotePluginContext): boolean { |
| 84 | return plugin.settings.showCommentWidget !== false; |
no test coverage detected