From 5e95019b3f6881657e77b9aaae39dc9c378d969e Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Jan 2020 14:22:30 +1100 Subject: [PATCH] Missed a spot with this new string task thing The issue here was that we were using a string task but expecting to be able to set the origin straight after to point at the conflict, but because it's async it was actually resetting the origin to 0 after a little bit. The proper solution here is maybe to add a flag to that thing asking whether you want to reset main's origin. But I'm too lazy to do that right now so instead I'm just using setViewContent. That will probably cause issues in the future. --- pkg/gui/merge_panel.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 4b86cf6c0..5e6272f38 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -212,15 +212,16 @@ func (gui *Gui) refreshMergePanel() error { if err != nil { return err } - if err := gui.newStringTask("main", content); err != nil { - return err - } - if err := gui.scrollToConflict(gui.g); err != nil { - return err - } mainView := gui.getMainView() mainView.Wrap = false + if err := gui.setViewContent(gui.g, mainView, content); err != nil { + return err + } + gui.Log.Warn("scrolling to conflict") + if err := gui.scrollToConflict(gui.g); err != nil { + return err + } return nil }