Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spp-mattp opened this issue Dec 15, 2022 · 3 comments

Comments

@spp-mattp
Copy link

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);
@ocornut ocornut added the bug label Jan 4, 2023
ocornut added a commit that referenced this issue Jan 4, 2023
… character of a multiline buffer which doesn't end with a carriage return. (#6000)

Simplify stb_textedit_find_charpos(). Leaving that to simmer for a while before attempting an upstream PR.
@ocornut
Copy link
Owner

ocornut commented Jan 4, 2023

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 57a5b73 + regression test ocornut/imgui_test_engine@5406171

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

@ocornut ocornut closed this as completed Jan 4, 2023
@Voyager1th
Copy link

imstb_textedit's multiline wordwrap cann't suppert

kjblanchard pushed a commit to kjblanchard/imgui that referenced this issue May 5, 2023
… character of a multiline buffer which doesn't end with a carriage return. (ocornut#6000)

Simplify stb_textedit_find_charpos(). Leaving that to simmer for a while before attempting an upstream PR.
ocornut added a commit to ocornut/imgui_test_engine that referenced this issue Sep 6, 2023
ocornut added a commit that referenced this issue Sep 6, 2023
@ocornut
Copy link
Owner

ocornut commented Sep 6, 2023

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:
#6783 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants