← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Nest level error, causes problems with git

 

Whoops, managed to mess upp the coding style while only changing 3 lines.. not very good

Updated

On 10/27/2017 11:03 AM, Kristoffer Ödmark wrote:
Hi! I found that the nest level when saving stuff is wrong ( error from the clipboard plugin ).

This patch fixes that so that version control systems doesnt generate large diffs when saving.



--
 -Kristoffer
>From 2a873579a1140c5fbbb98bb2e1a74b958acb49a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20=C3=96dmark?= <kristoffer.odmark90@xxxxxxxxx>
Date: Fri, 27 Oct 2017 10:59:49 +0200
Subject: [PATCH] Fixed nest level when saving to not get giant diffs with
 version control software such as git

---
 pcbnew/kicad_plugin.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp
index ad1a5a021..c26599bd3 100644
--- a/pcbnew/kicad_plugin.cpp
+++ b/pcbnew/kicad_plugin.cpp
@@ -532,8 +532,6 @@ void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const
 {
     const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings();
 
-    m_out->Print( 0, "\n" );
-
     // Setup
     m_out->Print( aNestLevel, "(setup\n" );
 
@@ -764,9 +762,9 @@ void PCB_IO::formatNetInformation( BOARD* aBoard, int aNestLevel ) const
 
 void PCB_IO::formatHeader( BOARD* aBoard, int aNestLevel ) const
 {
-    formatGeneral( aBoard );
+    formatGeneral( aBoard, aNestLevel );
     // Layers.
-    formatBoardLayers( aBoard );
+    formatBoardLayers( aBoard, aNestLevel );
     // Setup
     formatSetup( aBoard, aNestLevel );
     // Save net codes and names
@@ -775,7 +773,7 @@ void PCB_IO::formatHeader( BOARD* aBoard, int aNestLevel ) const
 
 void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
 {
-    formatHeader( aBoard );
+    formatHeader( aBoard, aNestLevel );
 
     // Save the modules.
     for( MODULE* module = aBoard->m_Modules;  module;  module = module->Next() )
-- 
2.14.3


References