From: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
To: git@vger.kernel.org
Cc: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Subject: [PATCH] Highlight every 5th line for add -i
Date: Fri, 13 Aug 2010 13:46:09 +0100 [thread overview]
Message-ID: <1281703569-8833-1-git-send-email-ciaran.mccreesh@googlemail.com> (raw)
It's easier to match up numbers to filenames when there's lots of output
that way.
---
git-add--interactive.perl | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 27fc793..542c29c 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -498,6 +498,7 @@ sub list_and_choose {
my $ref = ref $print;
my $highlighted = highlight_prefix(@{$prefixes[$i]})
if @prefixes;
+ my $this_line_color = '';
if ($ref eq 'ARRAY') {
$print = $highlighted || $print->[0];
}
@@ -511,7 +512,10 @@ sub list_and_choose {
else {
$print = $highlighted || $print;
}
- printf("%s%2d: %s", $chosen, $i+1, $print);
+ if ((! $opts->{LIST_FLAT}) && (($i + 1) % 5 == 0) && (@stuff >= 10)) {
+ $this_line_color = $header_color;
+ }
+ printf("%s%s%2d: %s%s", $chosen, $this_line_color, $i+1, $print, $normal_color);
if (($opts->{LIST_FLAT}) &&
(($i + 1) % ($opts->{LIST_FLAT}))) {
print "\t";
--
1.7.2
next reply other threads:[~2010-08-13 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 12:46 Ciaran McCreesh [this message]
2010-08-14 10:33 ` [PATCH] Highlight every 5th line for add -i Stephen Boyd
2010-08-14 18:58 ` Ciaran McCreesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281703569-8833-1-git-send-email-ciaran.mccreesh@googlemail.com \
--to=ciaran.mccreesh@googlemail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).