ImGuiTextFilter: added undocumented MinWordSize support. (#2435)
This commit is contained in:
parent
c74e7e93a3
commit
c0041b7d3c
@ -3094,6 +3094,7 @@ IM_MSVC_RUNTIME_CHECKS_RESTORE
|
|||||||
ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) //-V1077
|
ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) //-V1077
|
||||||
{
|
{
|
||||||
InputBuf[0] = 0;
|
InputBuf[0] = 0;
|
||||||
|
MinWordSize = 1;
|
||||||
_CountInclude = 0;
|
_CountInclude = 0;
|
||||||
if (default_filter)
|
if (default_filter)
|
||||||
{
|
{
|
||||||
@ -3127,7 +3128,7 @@ static void ImGuiTextFilter_BuildAddItem(ImGuiTextFilter* f, const char* word_b,
|
|||||||
word_e--;
|
word_e--;
|
||||||
}
|
}
|
||||||
const bool is_excl = (word_b < word_e && word_b[0] == '-');
|
const bool is_excl = (word_b < word_e && word_b[0] == '-');
|
||||||
if (word_e - word_b - (is_excl ? 1 : 0) <= 0)
|
if (word_e - word_b - (is_excl ? 1 : 0) < f->MinWordSize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Add to list
|
// Add to list
|
||||||
|
|||||||
1
imgui.h
1
imgui.h
@ -2811,6 +2811,7 @@ struct ImGuiTextFilter
|
|||||||
|
|
||||||
// [Internal] Members
|
// [Internal] Members
|
||||||
char InputBuf[256]; // User input buffer
|
char InputBuf[256]; // User input buffer
|
||||||
|
ImU8 MinWordSize; // == 1
|
||||||
int _CountInclude; // >= 0
|
int _CountInclude; // >= 0
|
||||||
ImVector<ImGuiTextFilterItem> _Items; // Pre-parsed, trimmed, reordered items
|
ImVector<ImGuiTextFilterItem> _Items; // Pre-parsed, trimmed, reordered items
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user