summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-10-22 21:48:43 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-10-22 22:16:52 +1100
commit80a8e9b04d6fe5214136f92c644e5a412a94c59e (patch)
treee8cfc40a6d509ac6751f69c8d4ee188a73bfb513
parent2008c3951616f9b366b320e805dcbd0c5da6ce96 (diff)
fix merge conflict scrolling
-rw-r--r--pkg/gui/tasks_adapter.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkg/gui/tasks_adapter.go b/pkg/gui/tasks_adapter.go
index 8d1f289db..61c3de083 100644
--- a/pkg/gui/tasks_adapter.go
+++ b/pkg/gui/tasks_adapter.go
@@ -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 {