https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc76250bd8cad3883397c…
commit bc76250bd8cad3883397c94ce091632e8424b066
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Fri Sep 6 08:25:40 2024 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Sep 6 08:25:40 2024 -0500
[COMCTL32] Fix edit control cursor positioning (#7317)
Fix caret positioning regression from Wine Sync to Wine 5.0 affecting notepad.
Restore older Wine code that handles caret position with ReactOS better.
This was a regression from 0.4.15-dev-8612-g0707475
https://github.com/reactos/reactos/commit/0707475f6974a0add99fc396146c26a97…
CORE-19731
---
dll/win32/comctl32/edit.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c
index 6d124ce64a4..767a63942f9 100644
--- a/dll/win32/comctl32/edit.c
+++ b/dll/win32/comctl32/edit.c
@@ -1050,7 +1050,15 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL
after_wrap)
lw = line_def->width;
w = es->format_rect.right - es->format_rect.left;
if (line_def->ssa)
+#ifdef __REACTOS__ /* CORE-19731 & match win32ss/user/user32/controls/edit.c */
+ {
+ ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x);
+ x -= es->x_offset;
+ }
+ else
+#else
ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x);
+#endif
#ifdef __REACTOS__ /* CORE-15780 */
x = (lw > 0 ? es->x_offset : x - es->x_offset);
#else