summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-11-24 18:53:05 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-11-24 18:53:05 -0800
commite8c324b4435a94877934f89c3ee339df52247062 (patch)
tree2468ee94c20cd889e5ef17564bcc92af677f9867 /tools
parent14b0731f8a74aad602e004fa726c53584bb72029 (diff)
downloadserverdata-e8c324b4435a94877934f89c3ee339df52247062.tar.gz
serverdata-e8c324b4435a94877934f89c3ee339df52247062.tar.bz2
serverdata-e8c324b4435a94877934f89c3ee339df52247062.tar.xz
serverdata-e8c324b4435a94877934f89c3ee339df52247062.zip
Fix indenting of item_db
At some point, 'make indent' needs to be run, but that will cause merge conflicts so I'm not doing it yet.
Diffstat (limited to 'tools')
-rw-r--r--tools/aligncsv.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/aligncsv.cpp b/tools/aligncsv.cpp
index 6e570e55..ef75ac00 100644
--- a/tools/aligncsv.cpp
+++ b/tools/aligncsv.cpp
@@ -7,10 +7,12 @@
#include <vector>
#include <string>
-// this configuration puts 3-6 spaces between entries (excluding headers)
+// this configuration puts 2-5 spaces between entries (excluding headers)
// and rounds the start of each field up to 4, for easier manual indenting
-const size_t min_pad = 3;
+// but force each field to be at least size 8
+const size_t min_pad = 2;
const size_t align_pad = 4;
+const size_t min_size = 8;
void add_pieces(std::vector<std::string>& line, std::vector<size_t>& sizes)
{
@@ -39,6 +41,8 @@ void add_pieces(std::vector<std::string>& line, std::vector<size_t>& sizes)
line[i].resize(--elt_size);
// mandatory padding and comma
elt_size += min_pad + 1;
+ if (elt_size < min_size)
+ elt_size = min_size;
if (elt_size > sizes[i])
// always true if we expanded sizes
sizes[i] = elt_size;