From 0ef9610e701ad8ca37928768dc54374a067eecf2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 29 Aug 2025 17:55:45 +0200 Subject: [PATCH] InputText, stb_textedit: Revert special handling when pressing Down/PageDown on last line of a buffer without a trailing carriage return. Revert fbf70070bb. --- docs/CHANGELOG.txt | 3 +++ imstb_textedit.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index b25af3124..9d1710a6d 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -55,6 +55,9 @@ Other Changes: In theory the buffer size should always account for a zero-terminator, but idioms such as using InputTextMultiline() with ImGuiInputTextFlags_ReadOnly to display a text blob are facilitated by allowing this. +- 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. - DrawList: fixed CloneOutput() unnecessarily taking a copy of the ImDrawListSharedData pointer, which could to issue when deleting the cloned list. (#8894, #1860) - Debug Tools: ID Stack Tool: fixed using fixed-size buffers preventing long identifiers diff --git a/imstb_textedit.h b/imstb_textedit.h index 5049715af..ac4db0fb9 100644 --- a/imstb_textedit.h +++ b/imstb_textedit.h @@ -921,8 +921,8 @@ retry: // [DEAR IMGUI] // going down while being on the last line shouldn't bring us to that line end - if (STB_TEXTEDIT_GETCHAR(str, find.first_char + find.length - 1) != STB_TEXTEDIT_NEWLINE) - break; + //if (STB_TEXTEDIT_GETCHAR(str, find.first_char + find.length - 1) != STB_TEXTEDIT_NEWLINE) + // break; // now find character position down a row state->cursor = start;