Skip to content

Commit

Permalink
improve edit_ex
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Mar 4, 2025
1 parent 49a1142 commit 39ed71e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 最新动态

2025/03/04
* 完善 edit_ex(感谢兆坤提供补丁)

2025/02/28
* 完善 sync state to children(感谢兆坤提供补丁)
* 完善 edit_ex(感谢兆坤提供补丁)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ static ret_t edit_ex_suggest_words_widget_props_format_parse(edit_ex_t* edit_ex,
str_init(&value, 0);

for (prop_format = tokenizer_next(&t); prop_format != NULL; prop_format = tokenizer_next(&t)) {
tokenizer_t t_sub;
tokenizer_init(&t_sub, prop_format, UINT32_MAX, "=");
str_set(&name, tokenizer_next(&t_sub));
const char* iter_eq = strchr(prop_format, '=');
return_value_if_fail(iter_eq != NULL, RET_BAD_PARAMS);

str_set_with_len(&name, prop_format, iter_eq - prop_format);
str_trim(&name, " \r\n");
str_set(&value, tokenizer_next(&t_sub));
str_set(&value, iter_eq + 1);
str_trim(&value, " \r\n");
if (name.size > 0 && value.size > 0) {
if (value.str[0] == '$') {
Expand All @@ -171,7 +172,6 @@ static ret_t edit_ex_suggest_words_widget_props_format_parse(edit_ex_t* edit_ex,
}
widget_set_prop_str(widget, name.str, value.str);
}
tokenizer_deinit(&t_sub);
}

str_reset(&value);
Expand Down

0 comments on commit 39ed71e

Please sign in to comment.