Explorar o código

InputText, stb_textedit: Revert special handling when pressing Down/PageDown on last line of a buffer without a trailing carriage return.

Revert fbf70070bb.
ocornut hai 1 semana
pai
achega
0ef9610e70
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 3 0
      docs/CHANGELOG.txt
  2. 2 2
      imstb_textedit.h

+ 3 - 0
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

+ 2 - 2
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;