Skip to content

Commit

Permalink
Update line count with text-reader
Browse files Browse the repository at this point in the history
  • Loading branch information
konect-V committed Aug 28, 2024
1 parent db1f693 commit ef18875
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sources/core/apps/text-reader/source/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,19 @@ kframebuffer_t* load_buffer(){

{
char* line_count_str = NULL;
assert(asprintf(&line_count_str, "%04d", col_count + 1) >= 0);
if(col_count + 1 < 10000){
assert(asprintf(&line_count_str, "%04d", col_count + 1) >= 0);
}else{
assert(asprintf(&line_count_str, "++++") >= 0);
}
uint32_t line_count_x = 0;
while(*line_count_str){
char* line_count_char_inc = line_count_str;
while(*line_count_char_inc){
line_count_x += FONT_WIDTH;
bitmap_setchar(framebuffer, line_count_x, cy_pos, *line_count_str, TEXT_COLOR);
line_count_str++;
bitmap_setchar(framebuffer, line_count_x, cy_pos, *line_count_char_inc, TEXT_COLOR);
line_count_char_inc++;
}
free(line_count_str);
}

while(*c){
Expand Down

0 comments on commit ef18875

Please sign in to comment.