You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a file named foo, which contains two only-one-character lines: a and b.
~: cat foo
a
b
If I search this file with ag, I get a result which shows three lines in foo file, and there is a phantom blank line at the last of file.
~: ag -C 3 b
foo
1-a
2:b
3- <-- This is the phantom line
After some attempts of guess and verification, I figured out that this issue may be related to LF at last line. The phantom line disappeared if I stripped the LF.
I'm not sure this behavior is a feature or a bug of ag, but vim treats LF at last line as an end of line but not a start of new line, therefore it appends LF by default. This causes troubles when searching these files with ag.
In contrast, ack does not append phantom line with same file.
~: ack -C 3 b
foo
1-a
2:b
Thanks in advance.
footnote:
os: OS X v10.10.3
ag: v0.30.0
ack: 2.14
The text was updated successfully, but these errors were encountered:
I have a file named
foo
, which contains two only-one-character lines:a
andb
.If I search this file with
ag
, I get a result which shows three lines infoo
file, and there is a phantom blank line at the last of file.After some attempts of guess and verification, I figured out that this issue may be related to LF at last line. The phantom line disappeared if I stripped the LF.
I'm not sure this behavior is a feature or a bug of
ag
, but vim treats LF at last line as an end of line but not a start of new line, therefore it appends LF by default. This causes troubles when searching these files withag
.In contrast,
ack
does not append phantom line with same file.Thanks in advance.
footnote:
os: OS X v10.10.3
ag: v0.30.0
ack: 2.14
The text was updated successfully, but these errors were encountered: