Skip to content

Commit

Permalink
Merge from 5.x: PR #21696
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Jan 21, 2024
2 parents 66cfd5e + 256de5f commit 19f0fcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spyder/plugins/editor/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2745,7 +2745,9 @@ def renamed_tree(self, source, dest):
tofile = to_text_string(dest)
for fname in self.get_filenames():
if osp.abspath(fname).startswith(dirname):
new_filename = fname.replace(dirname, tofile)
source_re = "^" + re.escape(source)
dest_quoted = dest.replace("\\", r"\\")
new_filename = re.sub(source_re, dest_quoted, fname)
self.renamed(source=fname, dest=new_filename)

#------ Source code
Expand Down

0 comments on commit 19f0fcc

Please sign in to comment.