osa1 / sg

A syntax-aware grep-like code search tool
MIT License
47 stars 1 forks source link

Multiple matches in same line reported as multiple lines #8

Open osa1 opened 2 years ago

osa1 commented 2 years ago

Compare:

$ sg --rust bytes
/home/omer/rust/sg/src/main.rs
266:            let token_str = match node.utf8_text(bytes) {
244:    let bytes = contents.as_bytes();
244:    let bytes = contents.as_bytes();
224:    let tree = match cfg.parser.borrow_mut().parse(contents.as_bytes(), None) {

$ ag --rust bytes
src/main.rs
224:    let tree = match cfg.parser.borrow_mut().parse(contents.as_bytes(), None) {
244:    let bytes = contents.as_bytes();
266:            let token_str = match node.utf8_text(bytes) {

With ag, line 244 is shown once, with all occurrences of bytes highlighted.