Here's a patch which adds SCI_AUTOCSETMINWIDTH and SCI_AUTOCGETMINWIDTH enabling containers to optionally specify a minimum width of an autocompletion list expressed as the number of characters. This can be used to give the list a look more similar to the lists used by VS Code and Visual Studio which both use a generous minimum width. (In VS Code it's about 50 characters for both the minimum and maximum width.)
The patch includes updates of Scintilla.iface and ScintillaDoc.html + a new test.
https://github.com/jrsoftware/scintilla/pull/10.patch
https://github.com/jrsoftware/scintilla/pull/10.diff
https://github.com/jrsoftware/scintilla/pull/10/files
Why is this worth doing?
To me without a minimum size the list looks quite outdated and oddly small compared to other editors, like the ones I listed.
The change seems has not effect, see
ListBoxX::MinClientWidth()
andListBoxX::MaxTrackSize()
in PlatWin.cxx.or here needs further patches (e.g. extend
ListOptions
).ScintillaBase::AutoCompleteStart sets the actual minimum size.
I think
WM_GETMINMAXINFO
set the min/max size?Last edit: Zufu Liu 2024-07-10
I thought
ListBoxX::MinClientWidth()
(used by WM_GETMINMAXINFO) needs updating to makeSCI_AUTOCSETMINWIDTH(characterCount)
work whencharacterCount < 12
:Have you looked at ScintillaBase::AutoCompleteStart?
It takes the minimum sizes (AutoComplete's own minimum of 100 pixels and the listbox's desired width as returned by GetDesiredRect (which is 15,6 times the average char width on Win32 as returned by ListBoxX::MinClientWidth)) and calculates the final minimum size but taking the maximum.
In the same place it handles the maximum size set by SCI_AUTOCSETMAXWIDTH.
So I'm pretty sure that this is the correct place to handle a third minimum size set by SCI_AUTOCSETMINWIDTH and saying the patch has no effect is a strange thing to say because it definitely does. In only does nothing if you set a width lower than the preexisting hardcoded (small) minimum widths which seems like a good thing.
Last edit: Martijn Laan 2024-07-10
Looks
ScintillaBase::AutoCompleteStart()
set the initial displayed size,ListBoxX::MinTrackSize()
andListBoxX::MaxTrackSize()
set actually min/max size that can be resized.The application may find the autocompletion list and change its size using the Win32 API.
Without stronger motivation, I do not see this as being worth implementing. Every feature costs maintenance effort.