void (EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; JViewport viewport = editor.getScrollPane().getViewport(); viewport.setExtentSize(viewport.getExtentSize().getWidth() == 0 ? new Dimension(1000, 1000) : new Dimension(0, 0)); }