sampson-chen / sack

s(hortcut)-ack: a faster way to use ag, ack (or grep)!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context lines shouldn't be tagged

elzibubble opened this issue · comments

If I run sack with -C3, I get output like:

/home/lealexis/w/nova/nova/objects/fixed_ip.py
[1] 122-        if expected_attrs is None:
[2] 123-            expected_attrs = []
[3] 124-        get_network = 'network' in expected_attrs
[4] 125:        db_fixedip = db.fixed_ip_get(context, id, get_network=get_network)
[5] 126-        return cls._from_db_object(context, cls(context), db_fixedip,
[6] 127-                                   expected_attrs)
[7] 128-

Only [4] is follow-able though.

It'd be better if only the middle line was tagged and followable. This would help prevent the tag numbers growing so quickly.

If you fix this, please ensure context lines are properly indented so the code aligns correctly.

Also remember that two context sections can run together. In this case, both hits should be numbered.