Skip to content

Commit

Permalink
Don't scroll cursor into view on setValue
Browse files Browse the repository at this point in the history
Closes #4657
  • Loading branch information
marijnh committed Mar 31, 2017
1 parent aadf2df commit 3424cc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/model/Doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ Doc.prototype = createObj(BranchChunk.prototype, {
let top = Pos(this.first, 0), last = this.first + this.size - 1
makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
text: this.splitLines(code), origin: "setValue", full: true}, true)
setSelection(this, simpleSelection(top))
if (this.cm) this.cm.scrollTo(0, 0)
setSelection(this, simpleSelection(top), sel_dontScroll)
}),
replaceRange: function(code, from, to, origin) {
from = clipPos(this, from)
Expand Down

0 comments on commit 3424cc3

Please sign in to comment.