InputTextMultiline: Incorrect cursor navigation from end of multiline input text #6000

Closed
opened 2022-12-15 19:35:47 +00:00 by spp-mattp · 3 comments
spp-mattp commented 2022-12-15 19:35:47 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: 1.87
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_win32 + imgui_impl_dx11
Compiler: MSVC 2022 (v143 build tools)
Operating System: Windows 10

My Issue/Question:

If the cursor is at the very end of the last line of a multiline input text (that is not empty) and the user presses the Up arrow key, the cursor will move to the beginning of the last line of text, instead of moving up by one line.

Standalone, minimal, complete and verifiable example:

static char * text = "aaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbb\nccccccccccccccccccccccccccc";
ImGui::InputTextMultiline("##test", text, strlen(text) + 1);
**Version/Branch of Dear ImGui:** Version: 1.87 Branch: docking **Back-end/Renderer/Compiler/OS** Back-ends: imgui_impl_win32 + imgui_impl_dx11 Compiler: MSVC 2022 (v143 build tools) Operating System: Windows 10 **My Issue/Question:** If the cursor is at the very end of the last line of a multiline input text (that is not empty) and the user presses the Up arrow key, the cursor will move to the beginning of the last line of text, instead of moving up by one line. **Standalone, minimal, complete and verifiable example:** ```c++ static char * text = "aaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbb\nccccccccccccccccccccccccccc"; ImGui::InputTextMultiline("##test", text, strlen(text) + 1); ```
ocornut commented 2023-01-04 17:02:03 +00:00 (Migrated from github.com)

This has been a long standing niggle in stb_textedit
I've looking into it and I think I've got a fix now:

Fix 57a5b73a4c + regression test ocornut/imgui_test_engine@54061717d5

I'll let that simmer for a while before attempting a PR in stb repository.

This has been a long standing niggle in stb_textedit I've looking into it and I think I've got a fix now: Fix 57a5b73a4cd86ec8f7d4295010d7d082a07b806c + regression test https://github.com/ocornut/imgui_test_engine/commit/54061717d5395bb58704919c3695bd866cca133d I'll let that simmer for a while before attempting a PR in stb repository.
Voyager1th commented 2023-04-02 14:22:33 +00:00 (Migrated from github.com)

imstb_textedit's multiline wordwrap cann't suppert

imstb_textedit's multiline **wordwrap** cann't suppert
ocornut commented 2023-09-06 09:37:14 +00:00 (Migrated from github.com)

I'll let that simmer for a while before attempting a PR in stb repository.

Turn out there was a bug in this change, which is now fixed:
https://github.com/ocornut/imgui/issues/6783#issuecomment-1708005641

> I'll let that simmer for a while before attempting a PR in stb repository. Turn out there was a bug in this change, which is now fixed: https://github.com/ocornut/imgui/issues/6783#issuecomment-1708005641
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#6000
No description provided.