summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/provider/provider.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 65624ff8..fcc471ce 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,7 @@
## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
+* `FIX` Renaming files in the directory leads to the auto-correction in "require" adding extra characters.
## 3.10.4
`2024-8-16`
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 6a4b2406..3d1c5d52 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -222,7 +222,7 @@ m.register 'workspace/didRenameFiles' {
for _, uri in ipairs(childs) do
if files.exists(uri) then
local ouri = uri
- local tail = ouri:sub(#oldUri)
+ local tail = ouri:sub(#oldUri + 1)
local nuri = file.newUri .. tail
renames[#renames+1] = {
oldUri = ouri,