58 ms·
> Ag doesn't search line-by-line. Really? Am I misunderstanding this code that very much appears to search line by line? https://github.com/ggreer/the_silver_s
by burntsushi 10y ago
> Ag doesn't search line-by-line.
Really? Am I misunderstanding this code that very much appears to search line by line? https://github.com/ggreer/the_silver_searcher/blob/master/src/search.c#L113-L121 https://github.com/ggreer/the_silver_searcher/blob/master/sr...
GNU grep never does "throw line into buffer and then search it." GNU grep just searches the entire buffer at once.
- ggreer 10y agoYou didn't check to see what value opts.multiline has. It's initialized to TRUE in src/options.c. It's only set to FALSE if a user passes the undocumented --nomultiline option to ag. Default behavior with a regex query is https://github.com/ggreer/the_silver_searcher/blob/master/src/search.c#L92-L111 https://github.com/ggreer/the_silver_searcher/blob/master/sr...
- burntsushi 10y agoAh excellent, thank you for fixing my understanding. :-)