Sublime Forum

How to pass location parameters in view.show_popup()


@OdatNurd @FichteFoll @deathaxe

Documentation says
The default location of -1 will display the popup at the cursor, otherwise a text point should be passed.
I tried to pass tuple to the location parameter but it didn’t work for me.

How to make sure that every time when Html popup is opened at the same location? In what form we have to pass the location related paramenters ?



point is an int. the location is just a variable name I guess.



Can you please provide me any example as I’m still unable to understand it.
What if I want to open my popup on almost right hand side of editor window, what will be the values that I need to pass to location parameter ?



The point means the nth position (i.e., the nth char) in your file (or buffer if unsaved). “almost right hand side of editor window” sounds vague to me.



I tried it but this is text based location specific only
view.show_popup(b,location=view.text_point(10, 1))

I pinpoint at fix location. Could you suggest the actual parameters for it?



What actual parameters…? You have to calculate the position by yourself somehow depending on “almost right hand side of editor window”. It may involve layout things which I am not familiar with, so I cannot help that.



FYI, you don’t need to mention me or anyone of these three people. I read every post anyway and a mention doesn’t make me do that faster. Besides, there are many more helpful people on here.

It’s mostly a matter of how your question or problem is formulated and how much someone needs to ask questions to understand what it actually is that you want to know or struggle with, because that takes the most time.

1 Like