fix file history order number displaying 0 instead of 10#5635
Conversation
|
Hmm I am not the developer but the 0 is AFAIK intentional it is the key on the keyboard after 9 |
|
Indeed you can select files with the 0-9 keys when the file history menu is open. |
|
it is probably so old from 20 years ago it never got fully documented and the other old one has traditionally been used without 0 |
|
I concluded that, odd as it may look, this is intentional. If you open the menu with Alt key and navigate that way, the numbers in the file history are underlined, just like other menu shortcuts that appear when menus are accessed this way. In fact, my aesthetic fix breaks the number 0 key shortcut since only the first character in the history section is a shortcut, so the shortcut key for item 10 becomes 1 instead of 0. I normally use the mouse, so I did not even consider this, nor have I seen any other program do it this way. LibreOffice for example will display number 10 with the 0 underscored as the shortcut key. But it has to because it displays more than 10 recent items. |
Once 10 files have been opened, the file history menu displays the oldest item as number 0 instead of number 10.
This is caused by some arithmetic involving +1 and modulus.
For this fix to work, the loop bound in function
AppendRecentFilesToMenuand the modulus operand in functionAddFileMenuItemmust have the same value (they already did, I just made it explicit by replacing a "magic value" with the constantkFileHistoryMaxRecent). Otherwise the menu numbers may "wrap around".