mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
fix: greedy renaming (closes #237)
This commit is contained in:
@@ -330,17 +330,18 @@ local function recursive_substitution(dir, old, new)
|
|||||||
sedcommand = "sed -i ''"
|
sedcommand = "sed -i ''"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 's|\(\[\[foo\)\([]#|\]\)|\[\[MYTEST\2|g'
|
||||||
local replace_cmd = "rg -0 -l -t markdown '"
|
local replace_cmd = "rg -0 -l -t markdown '"
|
||||||
.. old
|
.. old
|
||||||
.. "' "
|
.. "' "
|
||||||
.. dir
|
.. dir
|
||||||
.. " | xargs -0 "
|
.. " | xargs -0 "
|
||||||
.. sedcommand
|
.. sedcommand
|
||||||
.. " 's|"
|
.. " 's|\\("
|
||||||
.. old
|
.. old
|
||||||
.. "|"
|
.. "\\)\\([]#|]\\)|"
|
||||||
.. new
|
.. new
|
||||||
.. "|g' >/dev/null 2>&1"
|
.. "\\2|g' >/dev/null 2>&1"
|
||||||
os.execute(replace_cmd)
|
os.execute(replace_cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user