Skip to content

Remove leading orphan separators from the context menu - #836

Open
loliri wants to merge 1 commit into
moudey:mainfrom
loliri:fix-menu-leading-separators
Open

Remove leading orphan separators from the context menu#836
loliri wants to merge 1 commit into
moudey:mainfrom
loliri:fix-menu-leading-separators

Conversation

@loliri

@loliri loliri commented Aug 16, 2026

Copy link
Copy Markdown

Problem

When modify rules move system items to another menu (menu=...) or hide them (vis=vis.remove), the separators that used to group those items can be left orphaned at the very top of the context menu — a stray separator as the first line.

Trailing orphan separators are already cleaned up by the existing // remove duplicate separators loop in ContextMenu.cpp, but leading ones are not handled at all.

Fix

Mirror the existing trailing cleanup: strip leading separator items from the assembled item list and clear the Separator::Top flag of the first remaining item.

Repro

modify(find='打开(O)' vis=vis.remove)
modify(find='固定到*' menu=title.more_options)

Right-click a .lnk file → the first line of the menu is an orphan separator (verified on zh-CN Windows 11, v1.9.18).

When modify rules move or hide system items, the separators that grouped
them can be left orphaned at the very top of the menu. Trailing orphan
separators are already cleaned up; this mirrors that cleanup for the
leading ones and clears the Top flag of the first remaining item.
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

Successfully merging this pull request may close these issues.

1 participant