1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

InputText: fixed pressing End (without Shift) in a multi-line selection from mistakenly moving cursor based on selection start.

This commit is contained in:
ocornut 2025-09-11 18:44:50 +02:00
parent e2b7d84e96
commit f36c65661c
2 changed files with 3 additions and 1 deletions

View file

@ -69,6 +69,8 @@ Other Changes:
- InputText: revert a change in 1.79 where pressing Down or PageDown on the last line - InputText: revert a change in 1.79 where pressing Down or PageDown on the last line
of a multi-line buffer without a trailing carriage return would keep the cursor of a multi-line buffer without a trailing carriage return would keep the cursor
unmoved. We revert back to move to the end of line in this situation. unmoved. We revert back to move to the end of line in this situation.
- InputText: fixed pressing End (without Shift) in a multi-line selection from
mistakenly moving cursor based on selection start.
- Focus, InputText: fixed an issue where SetKeyboardFocusHere() did not work - Focus, InputText: fixed an issue where SetKeyboardFocusHere() did not work
on InputTextMultiline() fields with ImGuiInputTextFlags_AllowTabInput, since on InputTextMultiline() fields with ImGuiInputTextFlags_AllowTabInput, since
they normally inhibit activation to allow tabbing through multiple items. (#8928) they normally inhibit activation to allow tabbing through multiple items. (#8928)

View file

@ -1154,7 +1154,7 @@ retry:
#endif #endif
case STB_TEXTEDIT_K_LINEEND: { case STB_TEXTEDIT_K_LINEEND: {
stb_textedit_clamp(str, state); stb_textedit_clamp(str, state);
stb_textedit_move_to_first(state); stb_textedit_move_to_last(str, state);
state->cursor = STB_TEXTEDIT_MOVELINEEND(str, state, state->cursor); state->cursor = STB_TEXTEDIT_MOVELINEEND(str, state, state->cursor);
state->has_preferred_x = 0; state->has_preferred_x = 0;
break; break;