fixed bug with -A
parent
86e4bb2db5
commit
4d33742482
|
@ -2462,7 +2462,7 @@ class Core
|
||||||
args.shift(2)
|
args.shift(2)
|
||||||
when "-B"
|
when "-B"
|
||||||
# also return arg lines before a match
|
# also return arg lines before a match
|
||||||
output_mods[:before] = (val.to_i * -1)
|
output_mods[:before] = val.to_i
|
||||||
# delete opt and val from args list
|
# delete opt and val from args list
|
||||||
args.shift(2)
|
args.shift(2)
|
||||||
when "-v"
|
when "-v"
|
||||||
|
@ -3037,7 +3037,7 @@ protected
|
||||||
before = before.to_i.abs
|
before = before.to_i.abs
|
||||||
start = line_num - before
|
start = line_num - before
|
||||||
start = 0 if start < 0
|
start = 0 if start < 0
|
||||||
finish = line_num + before
|
finish = line_num + after
|
||||||
return all_lines.slice(start..finish)
|
return all_lines.slice(start..finish)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue