MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / is_word_boundary_from_right

Function is_word_boundary_from_right

KBotExt/imgui/imgui_widgets.cpp:3715–3726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3713 }
3714
3715 static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx)
3716 {
3717 // When ImGuiInputTextFlags_Password is set, we don't want actions such as CTRL+Arrow to leak the fact that underlying data are blanks or separators.
3718 if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0)
3719 return 0;
3720
3721 bool prev_white = ImCharIsBlankW(obj->TextW[idx - 1]);
3722 bool prev_separ = is_separator(obj->TextW[idx - 1]);
3723 bool curr_white = ImCharIsBlankW(obj->TextW[idx]);
3724 bool curr_separ = is_separator(obj->TextW[idx]);
3725 return ((prev_white || prev_separ) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ);
3726 }
3727 static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx)
3728 {
3729 if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0)

Callers 2

Calls 2

ImCharIsBlankWFunction · 0.85
is_separatorFunction · 0.85

Tested by

no test coverage detected