LiveEnhancementSuite / LESforWindows

Ableton Live, supercharged (on Windows)
https://enhancementsuite.me/
MIT License
202 stars 22 forks source link

Submenus with same name get merged [Bug] #27

Open seb303 opened 2 years ago

seb303 commented 2 years ago

Describe the bug If submenus in different parts of the menu tree happen to have the same name, all items get merged and show up in both places

To Reproduce

/Test1

Item1
Item1

//Subfolder

Item2
Item2

..

/Test2

Item3
Item3

//Subfolder

Item4
Item4

..

Expected behavior Subfolder under Test1 should contain only Item2, and Subfolder under Test2 should contain only Item4. Current behaviour is that both items show up in both places.

System Windows 10 Live 11 LES Release 1.3.5

enoversum commented 1 year ago

@seb303 Yeah, that's definitely happening. One way to avoid this is inserting a space into the name, e.g. in the beginning or the end. I'm using emotions right at the beginning for menus and submenus, e.g. '📂Category name', so I insert a space more if I have the same sub-group in another context again. Not a solution to the bug, but a workaround after all.

Inversil commented 1 year ago

Ah yeah, the reason for this is a problem in the dynamic menu parser/compiler. Autohotkey uses variable names to keep track of submenus, and if two submenus get assigned the exact same name, I guess they overlap in some way. It shouldn't happen because I remember trying to avoid that... but I suppose it does anyway. The only solution I could think of is adding a routine that checks for this exact scenario- but I don't really know how to check for the existence of a sub-menu in the middle of the routine.

enoversum commented 1 year ago

@Inversil Thanks for getting back to this bug. It's not a huge problem for me, and I could circumvent it by adding the aforementioned spaces to the name of the folder. Those are not visible in the menu, but separate the 'duplicates' from each other. It might just be good to have some kind of warning for users somewhere in the docs.

seb303 commented 1 year ago

If I remember correctly, the problem also occurs if a top level menu has the same name as a sub menu. The workaround to add spaces on the end of the names is ok for me too. So I guess a good enough fix would be just to document this workaround. Thanks.