Sublime Forum

Controlling scroll position in an image pane

#1

I would like to adjust the SyncViewScroll package to support paired scrolling of an image and the corresponding text OCRed from that image. The package is quite old, but still works to pair scrolling of two text panes. However, when you attempt to enable scrolling in an image pane, you can’t because the menu and Command Palette items are missing/disabled.

I’m guessing the problem is that this command is declared as a subclass of sublime_plugin.TextCommand. Is that diagnosis correct? If that’s the case, I’m not sure of a way around it, since I don’t see any sibling or parent classes in the exposed API which would work with e.g. an ImageCommand.

Is my goal achievable using Sublime today?

Update: I’ve gotten the menu toggling issue resolved by switching to a WindowCommand. And windows have sheets(), so I can get access to the ImageSheet and the TextSheet. However, all of the viewport and scroll positoin methods are on View, which is specifc to TextSheets. So it looks like I may be out of luck. But if someone knows a way around this, I’m all ears!

BTW, I’m on ST 4200.

1 Like

#2

Indeed it is not currently possible, there is very little API exposed for sheets. Apparently sublimehq even started work on fixing one limitation over 2 years ago with nothing to show for it yet: https://github.com/sublimehq/sublime_text/issues/3826
But it is probably still worth logging on the issue tracker so sublimehq can gauge the interest in such functionality

1 Like