代码拉取完成,页面将自动刷新
From cb35bd029dedf39b7be4945d57176a5b1aa03da9 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 8 Nov 2018 21:39:28 +0100
Subject: [PATCH] format-table: always underline header line
(cherry picked from commit 30d98de00c68440ff4d77d851b4b3323c34027da)
Related: #1689832
---
src/basic/format-table.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/basic/format-table.c b/src/basic/format-table.c
index 809a4be284..3fcb97475c 100644
--- a/src/basic/format-table.c
+++ b/src/basic/format-table.c
@@ -1343,15 +1343,22 @@ int table_print(Table *t, FILE *f) {
field = buffer;
}
+ if (row == t->data) /* underline header line fully, including the column separator */
+ fputs(ansi_underline(), f);
+
if (j > 0)
fputc(' ', f); /* column separator */
- if (d->color && colors_enabled())
+ if (d->color && colors_enabled()) {
+ if (row == t->data) /* first undo header underliner */
+ fputs(ANSI_NORMAL, f);
+
fputs(d->color, f);
+ }
fputs(field, f);
- if (d->color && colors_enabled())
+ if (colors_enabled() && (d->color || row == t->data))
fputs(ANSI_NORMAL, f);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。