typst-preview icon indicating copy to clipboard operation
typst-preview copied to clipboard

Option to disable jumping into other files

Open miliog opened this issue 1 year ago • 3 comments

I'd like an option to disable jumping between files. In my particular case, I have a template which I do not want to modify or care how the internals look like. So when clicking somewhere on my document inside the preview, it should ideally try to jump to the relevant code within my current file, not dive into my template.

miliog avatar Oct 20 '23 14:10 miliog

It is a good point but that's not how jump-to-code work. Currently we just blindly use the span information carried in the Frame. (correct me if i'm wrong @Myriad-Dreamin). I agree this can be improved. But I guess this is an open problem at least for now.

Enter-tainer avatar Oct 20 '23 15:10 Enter-tainer

@Enter-tainer you are right, it is a known upstream problem. there will be a stack of source location corresponding to you clicking point in document. However typst doesn't select or synthesize an ideal location from stack, which is hard-to-solve.

Myriad-Dreamin avatar Oct 20 '23 18:10 Myriad-Dreamin

We could have some simple option, that rejects to jump to non-main file. But there are space for thinking smarter default setting for complex projects that have multiple files containing main content.

Myriad-Dreamin avatar Oct 20 '23 18:10 Myriad-Dreamin