Menu

#1554 [patch] SciTE: Skip context when going to diff message in output pane

Committed
closed
nobody
SciTE (288)
5
2025-06-08
2025-04-15
No

This is about diff messages in the output pane:

--- a/src/SciTEBuffers.cxx  Sun Apr 13 10:36:27 2025 +0200
+++ b/src/SciTEBuffers.cxx  Tue Apr 15 18:44:41 2025 +0200
@@ -2133,7 +2133,11 @@
               if (linePlace != std::string::npos)
                 atPos = linePlace + 2; // skip "@@ -1,1" and then " +"
             }

-            sourceLine = IntegerFromText(atMessage.c_str() + atPos) - 1;
+            SA::Line contextLine = atLine + 1;
+            while (GetLine(wOutput, contextLine)[0] == ' ') {
+              contextLine++;
+            }
+            sourceLine = IntegerFromText(atMessage.c_str() + atPos) + contextLine - atLine - 2;
           }
         }

When I double-click on the line with --- or +++ then SciTE jumps to the line specified at the @@ line. If I remember correctly then it was me who implemented this feature.

This patch skips the context - lines starting with space. The outcome is jumping right at the modified line and not usually 3 lines before.

Discussion

  • Jakub Vrána

    Jakub Vrána - 2025-04-15

    Here's the patch.

     
  • Neil Hodgson

    Neil Hodgson - 2025-04-16
    • labels: --> SciTE
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2025-04-16

    Committed as [db1a99].

     

    Related

    Commit: [db1a99]

  • Neil Hodgson

    Neil Hodgson - 2025-06-08
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB