You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
view.sel() seems to always return the selections of the primary view into a file, even when called on a secondary view into the file.
Steps to reproduce
Install this plugin, which prints the current line to the console when a selection is modified:
import sublime
import sublime_plugin
class HighlightLongLine(sublime_plugin.ViewEventListener):
def on_selection_modified(self):
for region in self.view.sel():
line = self.view.line(region.b)
print(self.view.substr(line))
Open a file, then open another view into the same file, which I'll call View A and B.
Check the console output when moving the caret in each file.
Expected behavior
When browsing View A, the current line of View A will be printed to the console.
When browsing View B, the current line of View B will be printed to the console.
Actual behavior
When browsing View A, the current line of View A will be printed to the console twice.
When browsing View B, the current line of View A will be printed to the console twice.
It is not possible to obtain the selections from View B.
Environment
Build: 3211
Operating system and version: Windows 10
Thanks for your time.
The text was updated successfully, but these errors were encountered:
Description
view.sel() seems to always return the selections of the primary view into a file, even when called on a secondary view into the file.
Steps to reproduce
Expected behavior
When browsing View A, the current line of View A will be printed to the console.
When browsing View B, the current line of View B will be printed to the console.
Actual behavior
When browsing View A, the current line of View A will be printed to the console twice.
When browsing View B, the current line of View A will be printed to the console twice.
It is not possible to obtain the selections from View B.
Environment
Thanks for your time.
The text was updated successfully, but these errors were encountered: