Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Refresh open files after a global replace #6229
This issue stems from a post on the community forums: https://community.rstudio.com/t/r-studio-version-1-3-820-global-find-replace-does-not-work/52683
Steps to reproduce the problem
Open a file in RStudio. Perform a global find and replace for a word in the file. Although the file has changed outside of RStudio, the IDE does not reflect the change or indicate that there are now unsaved changes (reverting the replace) in the file.
Describe the problem in detail
After performing a global replace we are not refreshing the currently open files to display the new results. This could lead to confusion when a user has multiple files open and performs a replace across them. It is currently very easy for changes to be lost.
Describe the behavior you expected
When an open file is modified by a replace operation and doesn't have unsaved changes, refresh the file's buffer so the changes are displayed.
After further research, the original description in this issue is not accurate. The files will be refreshed, though in windows this is briefly delayed and in the case of macos this won't happen until the user clicks into the file. It would be nice to have this happen automatically after a replace but it no longer needs to be a 1.3 bug. I'm closing this out and will open an enhancement.