Sublime Forum

Neither done nor cancel called on input panel when NEW input panel created

#1

I have an input panel that, when open, sets a state value so that various keyboard commands apply to it via on_query_context. I may as well come out and say that it’s an implementation of incremental search and the bindings are subject to the context “i_search_active” key.

I also use another plugin called iOpener which also opens an input panel.

The problem is, If I invoke the iOpener command while my incremental search is in progress, my isearch input panel doesn’t receive any indication that it’s done or canceled. Therefore, on_query_context continues to return True and my key bindings invoke the functions of a panel that has been replaced with another one.

This is a bug right? Can this be fixed?

1 Like

#2

I guess you could store the view’s id when you display your input panel and compare it in your on_query_context to work around it

0 Likes

#3

Could you be more specific?

I don’t think I can ask the input panel (there is no input panel object as far as I know) what it’s current view is after the fact, can I? So how does this help me?

0 Likes

#4

Oh wow. I think I just discovered that the input panel gets a new set of view.settings().

Problem solved!

0 Likes

#5

Might have been too hasty to declare victory … That definitely did not work. I think you get a new set of settings whenever the input panel is opened, but if another command just opens the panel while it’s already open, the settings are not reset.

Meanwhile, I worked around this problem by keeping track of the change_count() on the input panel’s view, and if it gets out of sync, I can then tell that somebody else has taken over the input panel.

Annoying.

0 Likes

#6

It sounds like it is most likely a bug to me. I would except cancel to be called.

2 Likes

#7

Hi @wbond,

You have helped me before. Are you one of the developers for Sublime?

If so and if you agree that this is a bug, is it something that might get fixed? :slightly_smiling:

Cheers either way.

0 Likes

#8

Yes, Jon hired me a year ago.

I will look into getting this fixed. If you can open an issue on the tracker at https://github.com/SublimeTextIssues/Core/issues, that will ensure it doesn’t get lost in the shuffle.

0 Likes

#9

Issue number 1561.

0 Likes