summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-20 08:04:51 +0100
committerBenBE <BenBE@geshi.org>2020-11-24 19:05:48 +0100
commitf0a232568f3f765fdcb6a2e3570bd7e71858dbc9 (patch)
treed2b65cbb53f1206b85e1258def48a47d691d1f1b /linux
parentdde2af1fdba9ce3b59b4f3386ec2c0664373cb94 (diff)
Reduce visual noise to when comm and cmdline actually disagree on the program basename
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcess.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index cedc2162..e95be3e6 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -467,7 +467,7 @@ void LinuxProcess_makeCommandStr(Process* this) {
return;
}
-static void LinuxProcess_writeCommand(const Process* this, int attr, int baseattr, RichString* str) {
+static void LinuxProcess_writeCommand(const Process* this, int attr, int baseAttr, RichString* str) {
const LinuxProcess *lp = (const LinuxProcess *)this;
int strStart = RichString_size(str);
int baseStart = strStart + lp->mergedCommand.baseStart;
@@ -489,12 +489,17 @@ static void LinuxProcess_writeCommand(const Process* this, int attr, int baseatt
/* If it was matched with procExe's basename, make it bold if needed */
if (commStart == baseStart && highlightBaseName) {
if (commEnd > baseEnd) {
- RichString_setAttrn(str, A_BOLD | commAttr, commStart, baseEnd - 1);
+ RichString_setAttrn(str, A_BOLD | baseAttr, commStart, baseEnd - 1);
baseStart = baseEnd;
RichString_setAttrn(str, commAttr, baseStart, commEnd - 1);
- } else {
+ } else if (commEnd < baseEnd) {
RichString_setAttrn(str, A_BOLD | commAttr, commStart, commEnd - 1);
baseStart = commEnd;
+ // Remainder marked baseAttr at end of function
+ } else {
+ // Actually should be highlighted commAttr, but marked baseAttr to reduce visual noise
+ RichString_setAttrn(str, A_BOLD | baseAttr, commStart, commEnd - 1);
+ baseStart = commEnd;
}
} else {
RichString_setAttrn(str, commAttr, commStart, commEnd - 1);
@@ -505,7 +510,7 @@ static void LinuxProcess_writeCommand(const Process* this, int attr, int baseatt
}
}
if (baseStart < baseEnd && highlightBaseName) {
- RichString_setAttrn(str, baseattr, baseStart, baseEnd - 1);
+ RichString_setAttrn(str, baseAttr, baseStart, baseEnd - 1);
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy