From eb6776e05eea4a2ca88a985abc0c201a5a18c8f0 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 17 Sep 2009 16:51:03 +0200
Subject: [PATCH] don't reset location marker if it would stay on the same line

---
 src/plugins/debugger/debuggerplugin.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index c769e4b1c11..6ca4586dea4 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1092,10 +1092,16 @@ void DebuggerPlugin::gotoLocation(const StackFrame &frame, bool setMarker)
         if (setMarker)
             resetLocation();
     } else {
-        TextEditor::BaseTextEditor::openEditorAt(frame.file, frame.line);
-        if (setMarker) {
-            resetLocation();
-            m_locationMark = new LocationMark(frame.file, frame.line);
+        static QString lastFile;
+        static int lastLine;
+        if (frame.line != lastLine || frame.file != lastFile) {
+            lastLine = frame.line;
+            lastFile = frame.file;
+            TextEditor::BaseTextEditor::openEditorAt(frame.file, frame.line);
+            if (setMarker) {
+                resetLocation();
+                m_locationMark = new LocationMark(frame.file, frame.line);
+            }
         }
     }
 }
-- 
GitLab