Adds automatic scroll when block is on top or on the bottom of the code view