Skip to content

Commit

Permalink
Fix bug in scrolling the cursor into view
Browse files Browse the repository at this point in the history
Closes #6686
  • Loading branch information
marijnh committed May 14, 2021
1 parent c7aeed9 commit 687b6dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/display/scrolling.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function scrollPosIntoView(cm, pos, end, margin) {
// Set pos and end to the cursor positions around the character pos sticks to
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
// If pos == Pos(_, 0, "before"), pos and end are unchanged
pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos
pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
}
for (let limit = 0; limit < 5; limit++) {
let changed = false
Expand Down

0 comments on commit 687b6dd

Please sign in to comment.