summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/handlers/grep.rs4
1 files changed, 4 insertions, 0 deletions
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()