victorel-petrovich / notepad-plus-plus_vic

Notepad++ official repository
https://notepad-plus-plus.org/
Other
0 stars 0 forks source link

updateMenu() Q3. Off by 4 position for insertion of menu items? #7

Closed victorel-petrovich closed 1 year ago

victorel-petrovich commented 1 year ago

https://github.com/victorel-petrovich/notepad-plus-plus_lastRecentFileList.cpp/blob/26f402a71ec6ab86a07396a6249fadb5ee210dac/PowerEditor/src/lastRecentFileList.cpp#L390

The question in comments copied below: In case of sub-menu, how/why (_posBase+j) results in insertion at position after the 2 items: "empty recent files list" and bar, instead of at the top, because (_posBase) is position at the top of the sub-menu ?

Before this for-loop, if _size>0 ( and unless _pAccelerator->updateFullMenu(); does some tricks), in sub-menu have already next 4 items at top: (below I use abbreviations of the menu items; 1st is Restore Recent Closed File)

    RRCF            _posBase
    OARF            _posBase+1
    ERFL            _posBase+2
    -------         _posBase+3

If it was intended to placce after the last 2 items, then must have use (posBase+4+j), I think ?

victorel-petrovich commented 1 year ago

In other words, if it were according to my understanding, then the recent files should already appear at the top of the submenu.

victorel-petrovich commented 1 year ago

See my last commetns in prev. closed issues.