Skip to content

Click to open URL in Markdown file? #418

Answered by orbitalquark
jtherrmann asked this question in Q&A
Discussion options

You must be logged in to vote

If you want a text region to respond to a click, you have to use an indicator. Since lexer elements are not marked with indicators, you'd have to write a function to search for regions to mark, mark them, and then write an events.INDICATOR_CLICK handler to respond. The following example is from an old quick reference book. It's not exactly what you need, but it illustrates the process:

-- Define hyperlink indicator.
local INDIC_LINK = _SCINTILLA.next_indic_number()
events.connect(events.VIEW_NEW, function()
	view.indic_hover_style[INDIC_LINK] = view.INDIC_TEXTFORE
	view.indic_hover_fore[INDIC_LINK] = 0xFF0000 -- blue
end)
-- Search the buffer and mark hyperlinks.
function mark_hyperlinks(…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jtherrmann
Comment options

Answer selected by jtherrmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants