Sublime Forum

[Help] How to write a command for "double click" action in a output panel

#1

Hello everyone!

As shown in the following figure, I have written a panel command to produce an outline for my latex file.
How can “double click” a line in the output panel to jump to the corresponding line in the latex file?
I have no clue how to complete that action.
Please explain the logic and related API to me.

Thank you!

0 Likes

#2

You need to set some special view settings for your output panel.

See https://docs.sublimetext.io/reference/settings.html#build-and-error-navigation-settings

For example if view is the View of you panel, then you could do something like

view.settings().set("result_line_regex", r"^0*(\d+).*$")

Probably you also need to have the file(path) in the panel and then set the "result_file_regex" as well to make it work, but I haven’t tried if that is strictly necessary.

0 Likes

#3

Thank you, this is helpful.

0 Likes