line-range: teach -L:RE to search from end of previous -L range

For consistency with -L/RE/, teach -L:RE to search relative to the end
of the previous -L range, if any.

The new behavior invalidates one test in t4211 which assumes that -L:RE
begins searching at start of file. This test will be resurrected in a
follow-up patch which teaches -L:RE how to override the default relative
search behavior.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric Sunshine
2013-08-06 09:59:46 -04:00
committed by Junio C Hamano
parent a6ac5f9864
commit 1ce761a524
4 changed files with 25 additions and 7 deletions

View File

@ -24,4 +24,5 @@ of lines before or after the line given by <start>.
+
If ``:<regex>'' is given in place of <start> and <end>, it denotes the range
from the first funcname line that matches <regex>, up to the next
funcname line.
funcname line. ``:<regex>'' searches from the end of the previous `-L` range,
if any, otherwise from the start of file.