Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't render staging view when it loses focus
As far as I understand, this was needed back when the staging context was still responsible for rendering its highlight (as opposed to the gocui view, as it is today). It was necessary to call it with isFocused=false so that it removed the highlight. The isFocused bool is no longer used today (and we'll remove it in the next commit), so there's no need to render the view here any more. This fixes flickering when leaving the staging view by pressing escape. The reason is that in this case the patch state was already set to nil by the time we get here, so we would render an empty view for a brief moment. On top of that, it fixes unwanted scrolling to the top when leaving the staging view. The reason for this is that we have code in layout that scrolls views up if needed, e.g. because the window got taller or the view content got shorter (added in jesseduffield#3839). This kicked in because we emptied the view, and scrolled it all the way to the top, which we don't want.
- Loading branch information