fix: fix can not scroll enum item with blank

This commit is contained in:
Alex Duan 2023-02-27 16:39:45 +08:00
parent 4976c80e2f
commit a0ae611a99
1 changed files with 3 additions and 6 deletions

View File

@ -536,7 +536,7 @@ SWord* addWord(const char* p, int32_t len, bool pattern) {
word->len = len; word->len = len;
// check format // check format
if (pattern) { if (pattern && len > 0) {
word->type = wordType(p, len); word->type = wordType(p, len);
} else { } else {
word->type = WT_TEXT; word->type = WT_TEXT;
@ -577,12 +577,9 @@ void parseCommand(SWords* command, bool pattern) {
while (word->next) { while (word->next) {
word = word->next; word = word->next;
} }
int len = i - start; word->next = addWord(p + start, i - start, pattern);
if (len > 0) {
word->next = addWord(p + start, len, pattern);
command->count++; command->count++;
} }
}
start = i + 1; start = i + 1;
} else { } else {
lastBlank = false; lastBlank = false;