zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
3.24k stars 210 forks source link

Make the file history (Alt + H) limit configurable [enhancement] #886

Open jay-ramani opened 1 week ago

jay-ramani commented 1 week ago

The file history (accessible via the Alt + H shortcut) seems to be limited to 32 right now, with no option to increase or configure in any way.

It would be a useful enhancement to have this limit configurable.

Notepad4 version: HD_i18n_x64_v24.09r5472 Windows version: Windows 11 version 23H2 (build 22631.4317)

Thanks and cheers.

zufuliu commented 1 week ago

The limit MRU_MAXITEMS can be increased to 64. https://github.com/zufuliu/notepad4/blob/ac3dac21f972349edd8b2867586b9235b29555b7/src/Helpers.h#L782-L793

https://github.com/zufuliu/notepad4/blob/ac3dac21f972349edd8b2867586b9235b29555b7/src/Helpers.cpp#L2514-L2526

jay-ramani commented 6 days ago

How about making the limit user configurable? Wouldn't it be useful to give control to the user?

zufuliu commented 6 days ago

How about making the limit user configurable?

Larger than 64 will make // find first zero bit in used implementation much complex than a single index = np2_ctz64(~used);

jay-ramani commented 5 days ago

Larger than 64 sounds good

zufuliu commented 4 days ago

Things maybe simple than I thought: limit quick access drop-down menu to 32 (only list most recent 32 files), then no need to change the np2_ctz() bitmap cache code. image

Change MRUList to dynamic allocate pszItems and record the capacity would be biggest change required to implement this feature: https://github.com/zufuliu/notepad4/blob/08020fe61f636dcbfbed5eb94f384ab8ad32e911/src/Helpers.h#L795-L801

zufuliu commented 2 days ago

Implemented by b1b1f9523febc4398c4969bab1ce416e522de570, the default (and minimum) is still 32, but can be changed on Recent File dialog. Change the value only has effect on next run (after close all Notepad4 window). image

jay-ramani commented 2 days ago

Sweet! Thank you for implemnting, Zufu.