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

Custom Commands plugin: "Edit Custom Commands" changes the order of the defined commands #2659

Closed
marcelpaulo opened this Issue Dec 16, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@marcelpaulo

marcelpaulo commented Dec 16, 2017

I arrange the order of the custom commands (plugin Custom Commands) so that the most frequently used are at the top of the list. When I click on Edit Custom Commands, the order of the commands within the list is changed. I am using version 4.1 (development, a04bee8)

Steps to reproduce:

  1. Check the current order of the commands in plugin Custom Commands:
    screenshot_2017-12-16_15-44-10
  2. Click on Edit Custom Commands:
    screenshot_2017-12-16_15-44-29
  3. Click on Close to come back to the list of commands:
    screenshot_2017-12-16_15-45-16

As you can see, the order of the commands was changed.

@marcelpaulo

This comment has been minimized.

marcelpaulo commented Dec 16, 2017

Just discovered something: whenever I click on Edit Custom Commands, the order of the commands is reversed, so that, when I click for the second time, the order is reverted to the original, starting point.

@declension declension added the bug label Dec 17, 2017

@frestr

This comment has been minimized.

Member

frestr commented Oct 21, 2018

The problem here is that the commands are stored as a dictionary (both in Python and in the saved json file), causing the ordering to be non-deterministic.

@marcelpaulo

This comment has been minimized.

marcelpaulo commented Oct 21, 2018

But the ordering is deterministic: whichever order I manually establish, it's reversed. It's never random. It's precisely a 180º reflection, so that if I save it twice, it reflects 360º: it goes back to it started from.

@lazka

This comment has been minimized.

Member

lazka commented Oct 21, 2018

fyi, Python dicts keep their insertion order since 3.6

@frestr frestr closed this in cc54c8a Oct 22, 2018

@frestr

This comment has been minimized.

Member

frestr commented Oct 22, 2018

@marcelpaulo @lazka I see, thanks. That made the fix pretty simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment