Skip to content

Commit

Permalink
fix merge conflict scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield committed Oct 22, 2021
1 parent 2008c39 commit 80a8e9b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pkg/gui/tasks_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,20 @@ func (gui *Gui) newStringTask(view *gocui.View, str string) error {
}

func (gui *Gui) newStringTaskWithoutScroll(view *gocui.View, str string) error {
// using empty key so that on subsequent calls we won't reset the view's origin
return gui.newStringTaskWithKey(view, str, "")
manager := gui.getManager(view)

f := func(stop chan struct{}) error {
gui.setViewContent(view, str)
return nil
}

// Using empty key so that on subsequent calls we won't reset the view's origin.
// Note this means that we will be scrolling back to the top if we're switching from a different key
if err := manager.NewTask(f, ""); err != nil {
return err
}

return nil
}

func (gui *Gui) newStringTaskWithKey(view *gocui.View, str string, key string) error {
Expand Down

0 comments on commit 80a8e9b

Please sign in to comment.