How to scroll inactive editor?


How to make inactive editor scroll to desire position?
I have editor in inactive pane and I’m trying to scroll it with this:

inactiveEditor.scrollToBufferPosition( position );

tried also

inactiveEditor.setCursorBufferPosition( [row, col], { autoscroll: true } );

but with no success, scroll isn’t affected until i click on editor or focus pane.
Is it a bug or am I doing something wrong?
I’m using Atom 1.19.0


It might help if you shared the whole function.


here relevant code:
this.editor is editor inside active pane
this.previewEditor is editor inside inactive pane

  PreviewView.prototype.syncScroll = function(){
    var bufferPosition, bufferRow, previewRow;
    if (!atom.config.get('ehelon-source-preview.enableSyncScroll')) {
    bufferPosition = this.editor.getCursorBufferPosition();
    bufferRow = bufferPosition.row;
    /* mapping from editor coordinates to previewEditor coordinates */
    previewRow = this.getPreviewLinePosition(bufferPosition);
    if (previewRow == null) {
    /* moving cursor to mapped location - cursor moved, but no scrolling */
    this.previewEditor.setCursorBufferPosition([previewRow, 0], {
      autoscroll: true
    this.previewEditor.scrollToBufferPosition([previewRow, 0]);
    /* selecting mapped line - works as expected */


If setCursorBufferPosition works, then I can’t think of any reason why scrollToBufferPosition would not. That’s mysterious.


After some research i looks that in stable 1.18 release everything works as expected.
I determined that minimal code that cause problem for me goes like this:

  • I create a new editor
  • split active pane with this new editor as only item
  • focus to new pane.

I don’t even invoke any scrolling function. It looks like this:

this is function that i invoke with a command:

toggle: function(){
    var editor, inactiveEditor, activePane, newPane;
    editor = atom.workspace.getActiveTextEditor();
    if (!editor) {
    inactiveEditor = atom.workspace.buildTextEditor();
    inactiveEditor.getTitle = function(){
      return 'Source Preview';
    inactiveEditor.isModified = function(){
      return false;
    activePane = atom.workspace.getActivePane();
    newPane = activePane.splitRight({
      items: [inactiveEditor]

Is this a bug or am I doing something wrong?