1

Some files stopped appearing when using the silver searcher in vim... and I just figured out that it happens when certain emoji combinations are inside the file. Even if those emojis are further down, after the term I'm looking for, the file doesn't show up in search results.

I removed emojis, and ta-da file is included in search results again. It's only certain emojies, When I leave this emoji in:

enter image description here

... then there's no problem. However if I have a line that looks like this: enter image description here

diff is like this: enter image description here

then it doesn't show up in search results.

Why could this be?

Using this table: http://unicode.org/emoji/charts/full-emoji-list.html I'm trying to figure out how to display using markup that doesn't make ag exclude the file.

This is as close as I've gotten: 👧 🏽

Alisso
  • 1,861
  • 1
  • 17
  • 32
  • 1
    1. Do you have the same issue with ag itself? 2. If yes, use its issue tracker. – romainl Oct 26 '17 at 19:07
  • Don't know, I guess so. o__o? I'm enterpreting that as "Find the ag project it's probably on github and report an issue there" - is that the meaning? :) – Alisso Oct 26 '17 at 19:33
  • Aha, as in - try it out side of vim, and see if the same thing happens - of course! – Alisso Oct 26 '17 at 20:12
  • Yeah, looks like you have found a bug. Use the project's issue tracker. – romainl Oct 27 '17 at 05:34

2 Answers2

0

Friend of mine took a look and found that this: https://github.com/ggreer/the_silver_searcher/blob/e081d080d1cc0ac24c7ca5f7da6fc4c9dfe35d0b/src/util.c#L324

might be the reason. " The reason (which you'll detect if you run "ag -a Elixir") is that the color codes somehow makes ag think you're looking at a binary. "

I'm off to try to create an issue.

Alisso
  • 1,861
  • 1
  • 17
  • 32
  • And now that I found the project, it has 246 issues. Feels like I'm wasting everyone's time if I report this. And so I'll think about it. – Alisso Oct 27 '17 at 18:53
0

Perhaps because they are interpreted as a binary file. Add a "--search-binary" to your search to circumvent this feature:

ag --search-binary "pattern" 
gregory
  • 10,969
  • 2
  • 30
  • 42