浏览代码

ENH: Only display the precontext or postcontext up to the next or previous warning or error

Andy Cedilnik 22 年之前
父节点
当前提交
3540324598
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      Source/cmCTest.cxx

+ 7 - 3
Source/cmCTest.cxx

@@ -1203,15 +1203,19 @@ int cmCTest::BuildDirectory()
         {
         {
         ll = kk - 6;
         ll = kk - 6;
         }
         }
-      for ( jj = kk; 
-            jj > 0 && jj > ll /* && markedLines[jj] == 0 */; 
+      for ( jj = kk-1; 
+            jj > 0 && jj > ll && markedLines[jj] != markedLines[kk]; 
             jj -- );
             jj -- );
+      while ( markedLines[jj] == markedLines[kk] && jj < kk )
+        {
+        jj ++;
+        }
       for (; jj < kk; jj ++ )
       for (; jj < kk; jj ++ )
         {
         {
         errorwarning.m_PreContext += lines[jj] + "\n";
         errorwarning.m_PreContext += lines[jj] + "\n";
         }
         }
       for ( jj = kk+1; 
       for ( jj = kk+1; 
-            jj < lines.size() && jj < kk + 7 /* && markedLines[jj] == 0*/; 
+            jj < lines.size() && jj < kk + 7 && markedLines[jj] != markedLines[kk]; 
             jj ++ )
             jj ++ )
         {
         {
         errorwarning.m_PostContext += lines[jj] + "\n";
         errorwarning.m_PostContext += lines[jj] + "\n";