Repository navigation
Add Rename to the Python Editor tab context menu - #670
Closed
horhulenko wants to merge 1 commit into
Closed
horhulenko wants to merge 1 commit into
horhulenko wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #666
Added a
Renamebutton to the context menu of the Python editor tab.Regarding the potential issues mentioned in #666:
QFile::renamewill not allow an existing file to be overwritten, and the user receives a notification about this in a modal window.ext4filesystem and on a Windows drive mounted in WSL, which is case-insensitive. Renaming the filea.pytoB.pywhile the fileb.pyalready exists fails on the mounted case-insensitive volume but succeeds onext4, where they are indeed two different files. Renaming where only the case of the name changes (with no name collisions) works in both cases. In neither of these cases was a file that the user did not attempt to rename overwritten. Qt already handles this on a per-platform basis, so no reimplementation is required here.The whole change is 70 lines including the changelog entry and the doc comments. I don't think that is a lot of code to weigh against a rename that currently takes five steps through two Save as dialogs, with a delete on the wrong file one misclick away.
HAL already decides where these scripts live, creates them, writes them, watches them for external changes and moves them around when you use
Save as. Renaming one is not reimplementing the file manager, it is the one operation on that list that is missing.If there are edge cases I have not covered, I would rather hear which ones and fix them than see the feature dropped over an effort estimate. Happy to extend the tests or the error handling if you name the cases you are worried about.