From 7375f7a165dabe430e12d531fedd84bb3a027c6b Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 13 Aug 2023 17:28:38 -0400 Subject: Add comment in lieu of test coverage for now --- src/handlers/grep.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/handlers/grep.rs b/src/handlers/grep.rs index 8c3b6ce8..ecfc7e2a 100644 --- a/src/handlers/grep.rs +++ b/src/handlers/grep.rs @@ -31,6 +31,10 @@ impl<'b> GrepLine<'b> { let old_len = self.code.len(); self.code = tabs::expand(&self.code, tab_cfg).into(); let shift = self.code.len().saturating_sub(old_len); + // HACK: it is not necessarily the case that all submatch coordinates + // should be shifted in this way. It should be true in a common case of: + // (a) the only tabs were at the beginning of the line, and (b) the user + // was not searching for tabs. self.submatches = self.submatches.as_ref().map(|submatches| { submatches .iter() -- cgit v1.2.3