Sublime Forum

[ST3] on_modify gets wrong view

#1

To reproduce:

  1. Create a plugin that receives on_modified.
  2. To make it easier to see what is happening, set the layout to 2 columns.
  3. Open a file in the left column.
  4. Clone the view, move the clone to the right column.
  5. Type in the view on the right.

on_modified receives the view on the left column, not the active view. Surely this is not the intended behavior.

0 Likes

#2

It seems that the view with the lowest id is the one that is passed to on_modified. I suspect it’s the same with other event handlers.

0 Likes

#3

# typewriter scrolling def on_modified(self, view): # TODO STBUG if the view is in a column, for some reason the parameter view, is not correct. This fix it:s window = view.window(); if not window: window = sublime.active_window() view = window.active_view()

0 Likes