Need to call set_viewport_position((0, 0)) before calling it again with previous scrollPos otherwise it scrolls to the top of the file when no changes were made to the file by PHPCS fixer.