Skip to content

Commit

Permalink
fix: autoBraceSimpleCaptureGroups for multi-digits like $19
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jul 3, 2024
1 parent 31475f0 commit 1086bc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/rip-substitute/rg-operations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function M.getSearchAndReplaceValuesFromPopup()

local toSearch, toReplace = unpack(vim.api.nvim_buf_get_lines(state.popupBufNr, 0, -1, false))
if config.regexOptions.autoBraceSimpleCaptureGroups then
toReplace = toReplace:gsub("%$(%d+)", "${%1}")
-- CAVEAT will not work if user has 10 capture groups (which should almost never happen though)
toReplace = toReplace:gsub("%$(%d)", "${%1}")
end
return toSearch, toReplace
end
Expand Down

0 comments on commit 1086bc4

Please sign in to comment.