-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Description of the bug
Consider the following Listener:
class Listener(sublime_plugin.EventListener):
def on_activated(self, view: sublime.View):
print("on_activated", view, view.window().active_view())
I would expect the view to always be equal to that returned by active_view(). I would also expect active_view() to return the view with the text cursor. However, active_view() seems to ignore text fields, console I/O panels, etc.
If I click on the console input text field, I get:
on_activated View(86) View(67)
If I pull up a Quick Panel, I see:
on_activated View(55) View(67)
Steps to reproduce
- Make a plugin with the above Listener example.
- Open the console
- Notice that there is a mismatch in the active views
Expected behavior
active_view() should return the active view, as indicated by the text cursor.
Actual behavior
active_view() ignores the console input fields, quick panel input field, console output, output panels, etc.
Sublime Text build number
4200
Operating system & version
macOS 14.7
(Linux) Desktop environment and/or window manager
No response
Additional information
To be clear: on_activated() is doing what I need it to do (return the View with the cursor / input focus), active_view() is not. Please do not fix this by changing the behavior of on_activated().
I recognize that changing active_view() might break existing plug-ins. Perhaps there should be an optional "include_elements" parameter that defaults to the old behavior:
def active_view(self, include_elements=False)OpenGL context information