Skip to content

Commit

Permalink
Disable smooth scrolling in visual mode
Browse files Browse the repository at this point in the history
  • Loading branch information
webkadiz committed Jun 25, 2021
1 parent bdf654a commit fa0b4fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content_scripts/mode_visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ class Movement {
scrollIntoView() {
if (DomUtils.getSelectionType(this.selection) !== "None") {
const elementWithFocus = DomUtils.getElementWithFocus(this.selection, this.getDirection() === backward);
if (elementWithFocus) { return Scroller.scrollIntoView(elementWithFocus); }
if (elementWithFocus) {
let savedSmoothScrollValue = Settings.get("smoothScroll");
Settings.set("smoothScroll", false);
Scroller.scrollIntoView(elementWithFocus);
Settings.set("smoothScroll", savedSmoothScrollValue);
}
}
}
}
Expand Down

0 comments on commit fa0b4fc

Please sign in to comment.