summaryrefslogtreecommitdiffstats
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2021-05-15 08:23:01 -0400
committerAndrew Gallant <jamslam@gmail.com>2021-05-15 08:27:59 -0400
commit94e4b8e301302097dad48b292560ce135c4d4926 (patch)
treec1999f9b418c734607f5905a44399f1937159404 /CHANGELOG.md
parent2af77242c5b5186ea5ad6d05fa9aaef3d93c1603 (diff)
printer: fix --vimgrep for multi-line mode
It turned out that --vimgrep wasn't quite getting the column of each match correctly. Instead of printing column numbers relative to the current line, it was printing column numbers as byte offsets relative to where the match began. To fix this, we simply subtract the offset of the line number from the beginning of the match. If the beginning of the match came before the start of the current line, then there's really nothing sensible we can do other than to use a column number of 1, which we now document. Interestingly, existing tests were checking that the previous behavior was intended. My only defense is that I somehow tricked myself into thinking it was a byte offset instead of a column number. Kudos to @bfrg for calling this out in #1866: https://github.com/BurntSushi/ripgrep/issues/1866#issuecomment-841635553
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af9bbb2b..4d0e1175 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,8 @@ Bug fixes:
Document cygwin path translation behavior in the FAQ.
* [BUG #1741](https://github.com/BurntSushi/ripgrep/issues/1741):
Fix stdin detection when using PowerShell in UNIX environments.
+* [BUG #1866](https://github.com/BurntSushi/ripgrep/issues/1866#issuecomment-841635553):
+ Fix bug when computing column numbers in `--vimgrep` mode.
12.1.1 (2020-05-29)