livereload: Maintain the scroll position if possible
authorYihui Xie <xie@yihui.name>
Tue, 22 Aug 2017 15:29:09 +0000 (10:29 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 22 Aug 2017 18:26:33 +0000 (20:26 +0200)
commit7231d5a829f8d97336a2120afde1260db6ee6541
treeb1ab5c8924175f39cfba5adf17cd7b523f5b3224
parent88e1bca92c9df7e6c8b0bdf5a830a58e5ecd8e09
livereload: Maintain the scroll position if possible

This fixes #3824: when the current pathname is the same as the one to be loaded, just call location.reload() so that the current scroll position can be preserved, instead of assigning to location.href, which will cause the scroll position to be lost.
livereload/livereload.go