summaryrefslogtreecommitdiff
path: root/git-request-pull.sh
diff options
context:
space:
mode:
authorWincent Colaiuta <win@wincent.com>2007-11-29 12:00:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-30 20:37:40 (GMT)
commit14cb50382c9027ca3b8cf8dbc0a26503a40f50c5 (patch)
tree4caa00e69d33a7d27a2dcc4abe0183f7195c58e6 /git-request-pull.sh
parent280e50c7e5c2c52cbcc452fa5fb254ee580ae39c (diff)
downloadgit-14cb50382c9027ca3b8cf8dbc0a26503a40f50c5.zip
git-14cb50382c9027ca3b8cf8dbc0a26503a40f50c5.tar.gz
git-14cb50382c9027ca3b8cf8dbc0a26503a40f50c5.tar.bz2
Highlight keyboard shortcuts in git-add--interactive
The user interface provided by the command loop in git-add--interactive gives the impression that subcommands can only be launched by entering an integer identifier from 1 through 8. A "hidden" feature is that any string can be entered, and a regex search anchored at the beginning of the string is used to find the uniquely matching option. This patch makes this feature a little more obvious by highlighting the first character of each subcommand (for example "patch" is displayed as "[p]atch"). A new function is added to detect the shortest unique prefix and this is used to decide what to highlight. Highlighting is also applied when choosing files. In the case where the common prefix may be unreasonably large highlighting is omitted; in this patch the soft limit (above which the highlighting will be omitted for a particular item) is 0 (in other words, there is no soft limit) and the hard limit (above which highlighting will be omitted for all items) is 3, but this can be tweaked. The actual highlighting is done by the highlight_prefix function, which will enable us to implement ANSI color code-based highlighting (most likely using underline or boldface) in the future. Signed-off-by: Wincent Colaiuta <win@wincent.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-request-pull.sh')
0 files changed, 0 insertions, 0 deletions