Skip to content
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

Alpha ST4 - Duplicate Rename entries on menu #49

Open
TerminalFi opened this issue Dec 17, 2019 · 6 comments
Open

Alpha ST4 - Duplicate Rename entries on menu #49

TerminalFi opened this issue Dec 17, 2019 · 6 comments

Comments

@TerminalFi
Copy link
Contributor

Sublime Text 4 Alpha 4061
FileManager - Latest Release via PackageControl

I know this is alpha, but might be a good way to get a jump start on updates.

image

@math2001
Copy link
Owner

math2001 commented Jan 4, 2020

Damn, I didn't hear about ST4 for a while, I'm not too involved with ST (anymore?). Anyway, thanks for reporting 🙂

I don't really wanna go through the hastle of finding the downloads for ST4 (and I don't think you should post them here either, I think they want it to be somewhat private).

Anyway, there are two options: remove the FileManager's rename command, or hide their command. If i throw out FileManager's rename, it's going to break consistency, though it's not that bad, I use their rename command all the time. Hiding their command is really easy (if the menu system still works the same way as in ST3, and it looks like it does from your screenshot)

I'm thinking throw out FIleManager's rename command. The less custom stuff, the better. What do you think?

@TerminalFi
Copy link
Contributor Author

I’ll remove FM function and see how everything flows. I really like FM over sidebar enhancements. Perhaps I’ll start familiarizing myself with ST4 API and try to keep FM up to date with PR’s

@TerminalFi
Copy link
Contributor Author

@math2001 Unless there is any functions we can implement that the current ST rename doesn't offer, then I believe we should just disable this menu item by default and mark as deprecated. That will then provide time to really think about it before ripping out the code.

@math2001
Copy link
Owner

Unless there is any functions we can implement that the current ST rename doesn't offer, then I believe we should just disable this menu item by default and mark as deprecated

Yep, thanks for making that clear in my head. That didn't stand out to me for some reason (guess I'll try to think a bit more next time).

I looked at the Sublime Text 3 rename.py, and it looks like it does everything that fm_delete would do, but better. There is no difference between ST4 and ST3's rename (it's just that neat 👌)

I wouldn't have thought of marking it as deprecated as a first step either, and that's clearly a much better thing to do.

math2001 added a commit that referenced this issue Jan 18, 2020
The slight problem is that if we don't disable the default command, then
it shows up before the `New` command, which isn't right.

So, instead, we enable the default (rename_path), but hide it
(is_visible() -> False). Then, we create our own little command
(fm_rename_path) that calls rename_path. Like this, we control where
fm_rename_path shows up in the context menu.

File Manager: Rename has been removed from the command palette (use
Rename File).

fm_rename now prints a deprecation warning. We don't use Python's
warning module because warnings aren't enabled by default, and I don't
want to change the defaults for everyone.

ref #49
@math2001
Copy link
Owner

Wait hang on, I can't quite understand how you got this context menu in the first place... the default rename command should have been disabled by prevent_default.py. I looked at the Default package, and it declares the same commands. That's kind of surprising.

Anyway, it's better to use the default command regardless.

@redgluten
Copy link

Just a little feedback: it seems that FM is quite unstable with ST4 I had an issue where deleting a file from the sidebar menus would delete two different files. After disabling FM the problem does not appears anymore.

If I understand correctly ST4 dev is already quite advanced and many people like me are using it because of compatibility issues of ST3 (macOS Big Sur and M1 chips in my case).

I don’t know if you plan to work on a proper ST4 upgrade since you mentioned not being so involved anymore, if that’s the case and you want a better bug report I can try to do that. In the meantime maybe a little warning in the Package Control install messages about the compatibility might prove useful.

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

3 participants