File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/renderer/components/CodeEditor Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ function getCursorTooltips(
3737 arrow : true ,
3838 create : ( ) => {
3939 const dom = document . createElement ( 'div' ) ;
40+ dom . addEventListener ( 'click' , ( e ) => {
41+ const target = e . target as HTMLElement ;
42+ const link = target . closest ( 'a' ) ;
43+ if ( link ) {
44+ e . preventDefault ( ) ;
45+ window . electron . openExternal ( link . href ) ;
46+ }
47+ } ) ;
4048 dom . className = 'cm-tooltip-cursor' ;
4149 dom . innerHTML = `
4250 <div style="max-width:700px;">
@@ -82,6 +90,14 @@ const functionTooltipBaseTheme = EditorView.baseTheme({
8290 borderTopColor : 'transparent' ,
8391 } ,
8492 } ,
93+ '.code-tooltip a' : {
94+ color : 'white' ,
95+ textDecoration : 'underline' ,
96+ } ,
97+ '.code-tooltip a:hover' : {
98+ color : 'white' ,
99+ textDecoration : 'none' ,
100+ } ,
85101} ) ;
86102
87103export function functionTooltip ( dict : TooltipDirectionary ) {
You can’t perform that action at this time.
0 commit comments