this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix bookmarks include whitespaces at the beginning of the name (#2642)

authored by

Miguel and committed by
GitHub
db9891d4 3d0780ef

+18 -8
+18 -8
src/studio/editors/code.c
··· 3453 3453 char filter[STUDIO_TEXT_BUFFER_WIDTH]; 3454 3454 strncpy(filter, code->popup.text, sizeof(filter)); 3455 3455 3456 - if(code->sidebar.size) 3457 - { 3458 - tic_api_rect(code->tic, rect.x - 1, rect.y + (code->sidebar.index - code->sidebar.scroll) * STUDIO_TEXT_HEIGHT, 3459 - rect.w + 1, TIC_FONT_HEIGHT + 2, tic_color_red); 3456 + if(code->sidebar.size) 3457 + { 3458 + tic_api_rect(code->tic, rect.x - 1, rect.y + (code->sidebar.index - code->sidebar.scroll) * STUDIO_TEXT_HEIGHT, 3459 + rect.w + 1, TIC_FONT_HEIGHT + 2, tic_color_red); 3460 3460 3461 - for(const tic_outline_item* ptr = code->sidebar.items, *end = ptr + code->sidebar.size; 3462 - ptr != end; ptr++, y += STUDIO_TEXT_HEIGHT) 3463 - drawFilterMatch(code, x, y, ptr->pos, ptr->size, filter); 3464 - } 3461 + for(const tic_outline_item* ptr = code->sidebar.items, *end = ptr + code->sidebar.size; 3462 + ptr != end; ptr++, y += STUDIO_TEXT_HEIGHT) 3463 + { 3464 + // find the first non-space character 3465 + const char* trimmed = ptr->pos; 3466 + while (*trimmed && isspace(*trimmed)) 3467 + trimmed++; 3468 + 3469 + // calculate the new size after trimming 3470 + size_t trimmed_size = ptr->size - (trimmed - ptr->pos); 3471 + 3472 + drawFilterMatch(code, x, y, trimmed, trimmed_size, filter); 3473 + } 3474 + } 3465 3475 else 3466 3476 { 3467 3477 if(code->shadowText)