Re: [PATCH] Highlight keyboard shortcuts in git-add--interactive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wincent Colaiuta <win@xxxxxxxxxxx> writes:

> A "hidden" feature is that any string can be entered, and an anchored
> regex search is used to find the first matching option.

I'd run s/the first/the uniquely/ here.

When list_and_choose() function is letting you choose more than one
items, its prompt becomes ">> ", instead of "> " that is used for a
singleton choice.  To that prompt, you can say "3-7" (Add these 5 items
to the choice), "*" (I want all of them), "-2-4" (exclude 2 and 3 and 4
from the set I have chosen so far).  These are also "hidden", and need
to be documented, but that would be a separate patch.

> +# given a prefix/remainder tuple return a string with the prefix highlighted
> +# for now use square brackets; later might use ANSI colors (underline, bold)
> +sub highlight_prefix {
> +	my $prefix = shift;
> +	my $remainder = shift;
> +	$prefix ? "[$prefix]$remainder" : $remainder;
> +}

I'd rewrite the last line to:

	return (defined $prefix) ? "[$prefix]$remainder" : $remainder;

just in case the unique prefix is "0".  Otherwise you would lose the
first letter from "00ReadMe" and show remainder "0ReadMe" alone.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux