function UserData_Callback(data) {
                            const user_data = data.UserData;
                            if (!data.HasSelection())
                                user_data.CursorPos = data.CursorPos;
                            if (data.SelectionStart === 0 && data.SelectionEnd === data.BufTextLen) {
                                // When not editing a byte, always rewrite its content (this is a bit tricky, since InputText technically "owns" the master copy of the buffer we edit it in there)
                                data.DeleteChars(0, data.BufTextLen);
                                data.InsertChars(0, user_data.CurrentBufOverwrite);
                                data.SelectionStart = 0;
                                data.SelectionEnd = data.CursorPos = 2;
                            }
                            return 0;
                        }
// FIXME: We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious. This is such a ugly mess we may be better off not using InputText() at all here.

We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious. This is such a ugly mess we may be better off not using InputText() at all here.
We should have a way to retrieve the text edit cursor position more easily in the API this is rather tedious . This is such a ugly mess we may be better off not using InputText () at all here .
function UserData_Callback(data) {
                            const user_data = data.UserData;
                            if (!data.HasSelection())
                                user_data.CursorPos = data.CursorPos;
                            if (data.SelectionStart === 0 && data.SelectionEnd === data.BufTextLen) {
                                data.DeleteChars(0, data.BufTextLen);
                                data.InsertChars(0, user_data.CurrentBufOverwrite);
                                data.SelectionStart = 0;
                                data.SelectionEnd = data.CursorPos = 2;
                            }
                            return 0;
                        }
function UserData_Callback ( data ) { const user_data = data . UserData ; if ( ! data . HasSelection ( ) ) user_data . CursorPos = data . CursorPos ; if ( data . SelectionStart === 0 && data . SelectionEnd === data . BufTextLen ) { data . DeleteChars ( 0 , data . BufTextLen ) ; data . InsertChars ( 0 , user_data . CurrentBufOverwrite ) ; data . SelectionStart = 0 ; data . SelectionEnd = data . CursorPos = 2 ; } return 0 ; }
FIXME: We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious.
FIXME : We should have a way to retrieve the text edit cursor position more easily in the API this is rather tedious .
// When not editing a byte, always rewrite its content (this is a bit tricky, since InputText technically "owns" the master copy of the buffer we edit it in there)
