Changed implementation
MODIFY
lib/project/results-view.js
lib/project/results-view.js
@@ -65,7 +65,6 @@ class ResultsView {
this.subscriptions = new CompositeDisposable(
atom.config.observe('editor.fontFamily', this.fontFamilyChanged.bind(this)),
- atom.workspace.observeActivePaneItem(this.maintainPreviousScrollPosition.bind(this)),
this.model.onDidAddResult(this.didAddResult.bind(this)),
this.model.onDidSetResult(this.didSetResult.bind(this)),
this.model.onDidRemoveResult(this.didRemoveResult.bind(this)),
@@ -107,6 +106,8 @@ class ResultsView {
}
render () {
+ this.maintainPreviousScrollPosition();
+
let regex = null, replacePattern = null;
if (this.model.replacedPathCount == null) {
regex = this.model.regex;
@@ -661,12 +662,11 @@ class ResultsView {
}
maintainPreviousScrollPosition() {
- if(this.selectedRowIndex === -1) {
+ if(this.selectedRowIndex === -1 || !this.currentScrollTop) {
return;
}
- setTimeout(() => {
+
this.setScrollTop(this.currentScrollTop);
- },50)
}
fontFamilyChanged(fontFamily) {

Changed implementation