From f36c65661c5534e215120eb96b7a2455ef1efc82 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 11 Sep 2025 18:44:50 +0200 Subject: [PATCH] InputText: fixed pressing End (without Shift) in a multi-line selection from mistakenly moving cursor based on selection start. --- docs/CHANGELOG.txt | 2 ++ imstb_textedit.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 2658bdb69..c195ed1eb 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -69,6 +69,8 @@ Other Changes: - 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 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 on InputTextMultiline() fields with ImGuiInputTextFlags_AllowTabInput, since they normally inhibit activation to allow tabbing through multiple items. (#8928) diff --git a/imstb_textedit.h b/imstb_textedit.h index 844be3b2b..c41078c8a 100644 --- a/imstb_textedit.h +++ b/imstb_textedit.h @@ -1154,7 +1154,7 @@ retry: #endif case STB_TEXTEDIT_K_LINEEND: { 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->has_preferred_x = 0; break;