Skip to content

Commit 3a34b72

Browse files
committed
fix renaming files in the directory leads to the auto-correction in "require" adding extra characters
fix #2810
1 parent d702a55 commit 3a34b72

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `FIX` Renaming files in the directory leads to the auto-correction in "require" adding extra characters.
56

67
## 3.10.4
78
`2024-8-16`

script/provider/provider.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ m.register 'workspace/didRenameFiles' {
222222
for _, uri in ipairs(childs) do
223223
if files.exists(uri) then
224224
local ouri = uri
225-
local tail = ouri:sub(#oldUri)
225+
local tail = ouri:sub(#oldUri + 1)
226226
local nuri = file.newUri .. tail
227227
renames[#renames+1] = {
228228
oldUri = ouri,

0 commit comments

Comments
 (0)