8000 [bug] strange behaviour when working on virtual drives mapped to directories · Issue #512 · focus-editor/focus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[bug] strange behaviour when working on virtual drives mapped to directories #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
8000
victor-Lopez25 opened this issue Feb 5, 2025 · 3 comments

Comments

@victor-Lopez25
Copy link

Describe the bug
Focus deletes work done when opening from focus.exe into virtual drive and having the x.focus-config project file looking at the directory associated (it also deletes work done when doing this the opposite way).

To Reproduce
Steps to reproduce the behavior:

  1. In cmd.exe do: subst [letter]: C:[directory] to create a virtual drive associated with a directory (don't worry, this only stays until the computer is turned off and you can also delete it with subst /D [letter])
  2. Open focus.exe
  3. Copy the "Example Project.focus-config" onto a new file
  4. On build_working_dir, start the full path using the virtual drive and set a preferred error_regex
  5. Switch to that project
  6. Using ctrl-o, open a file in the directory with the associated virtual drive
  7. Edit the file slightly (or a lot, whatever)
  8. Use the build command and jump to the first error
  9. You will go back to the previous file contents
  10. If you now do ctrl-tab, you should see two files which are named the same, but one's full path is from the virtual drive and the other from the physical drive
  11. If you repeat from step 7, this should happen again in some way

note that the changed text is a bit strange, I'm not sure what it depends on but you need to compile and go to the error to have it happen.
What happened to me exactly, were a couple name changes that I did, I needed to do them 2 or 3 times since the editor would overwrite the text in some way each time I did steps 7 and 8, it did work after a couple times, but I'm not sure which filepath I edited (the file from the virtual drive or the file from the physical drive) to have the text not get overwritten.

  • OS: Windows: 11
  • Focus Version: focus-nightly-7e88514
    Expected behavior
    File data to not be overwritten by old file data in this context.

Additional context
To be fair, this was a mistake on my part when I opened the file using the physical drive instead of the virtual one, but I thought it would be fine.

@obiwanus
Copy link
Collaborator
obiwanus commented Feb 5, 2025

Thanks for the report.

Just to clarify, at step 7 you don't save the file?

Focus currently has no way of knowing that 2 different paths point to the same underlying file. Being able to detect and handle that is a significant piece of work which involves redesigning the buffer system a litte.

We're a bit tied up with other work right now, but will get to this at some point when we can.

@victor-Lopez25
Copy link
Author

Ah sorry I forgot to mention it before, the file does get saved before building since I have save_all_file_backed_buffers_on_build and save_current_buffer_on_build in global.focus-config set to true.

I understand it's also a very specific issue and also a windows specific one too. It's also something that doesn't really get in the way most of the time so it's fine to keep the issue until there is less work to be done.

@victor-Lopez25 victor-Lopez25 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2025
@victor-Lopez25
Copy link
Author

I accidentally hit the not planned button, I'll leave it to you to decide when the bug fix is planned.

@victor-Lopez25 victor-Lopez25 reopened this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0