@@ -43,7 +43,7 @@ void decidedcancel_cb(void) {
43
43
// String changed callback.
44
44
void strchange_cb (const char * str , SwkbdChangedStringArg * arg ) {
45
45
JSValue args [] = {
46
- JS_NewStringLen (current_kbd -> ctx , str , arg -> stringLen ),
46
+ JS_NewString (current_kbd -> ctx , str ),
47
47
JS_NewInt32 (current_kbd -> ctx , arg -> cursorPos ),
48
48
JS_NewInt32 (current_kbd -> ctx , arg -> dicStartCursorPos ),
49
49
JS_NewInt32 (current_kbd -> ctx , arg -> dicEndCursorPos ),
@@ -60,7 +60,7 @@ void strchange_cb(const char *str, SwkbdChangedStringArg *arg) {
60
60
// Moved cursor callback.
61
61
void movedcursor_cb (const char * str , SwkbdMovedCursorArg * arg ) {
62
62
JSValue args [] = {
63
- JS_NewStringLen (current_kbd -> ctx , str , arg -> stringLen ),
63
+ JS_NewString (current_kbd -> ctx , str ),
64
64
JS_NewInt32 (current_kbd -> ctx , arg -> cursorPos ),
65
65
};
66
66
JSValue result = JS_Call (current_kbd -> ctx , current_kbd -> cursor_move_func ,
@@ -75,7 +75,7 @@ void movedcursor_cb(const char *str, SwkbdMovedCursorArg *arg) {
75
75
// Text submitted callback, this is used to get the output text from submit.
76
76
void decidedenter_cb (const char * str , SwkbdDecidedEnterArg * arg ) {
77
77
JSValue args [] = {
78
- JS_NewStringLen (current_kbd -> ctx , str , arg -> stringLen ),
78
+ JS_NewString (current_kbd -> ctx , str ),
79
79
};
80
80
JSValue result = JS_Call (current_kbd -> ctx , current_kbd -> submit_func ,
81
81
current_kbd -> instance , countof (args ), args );
0 commit comments