Ensure that lines aren't too long

Remove unnecessary println
master
Ronald 7 months ago
parent 9f83f47506
commit b21705984c

@ -119,7 +119,6 @@ init_sdl :: proc() -> int {
font_cstring := strings.clone_to_cstring(app.config.font)
defer delete(font_cstring)
fmt.println(font_cstring)
app.font = ttf.OpenFont(font_cstring, i32(app.config.font_size))
if app.font == nil {
@ -468,11 +467,23 @@ render_text_area :: proc() {
// Render line number background
line_bg_rect := sdl.Rect{0, TAB_HEIGHT, LINE_NUMBER_WIDTH, WINDOW_HEIGHT - TAB_HEIGHT}
sdl.SetRenderDrawColor(app.renderer, app.config.colours.line_numbers_background.r, app.config.colours.line_numbers_background.g, app.config.colours.line_numbers_background.b, app.config.colours.line_numbers_background.a)
sdl.SetRenderDrawColor(
app.renderer,
app.config.colours.line_numbers_background.r,
app.config.colours.line_numbers_background.g,
app.config.colours.line_numbers_background.b,
app.config.colours.line_numbers_background.a
)
sdl.RenderFillRect(app.renderer, &line_bg_rect)
// Render separator line
sdl.SetRenderDrawColor(app.renderer, app.config.colours.tab_border.r, app.config.colours.tab_border.g, app.config.colours.tab_border.b, app.config.colours.tab_border.a)
sdl.SetRenderDrawColor(
app.renderer,
app.config.colours.tab_border.r,
app.config.colours.tab_border.g,
app.config.colours.tab_border.b,
app.config.colours.tab_border.a
)
sdl.RenderDrawLine(app.renderer, LINE_NUMBER_WIDTH, TAB_HEIGHT, LINE_NUMBER_WIDTH, WINDOW_HEIGHT)
// Adjust scroll if cursor is outside visible area
@ -503,7 +514,13 @@ render_text_area :: proc() {
cursor_x := LINE_NUMBER_WIDTH + TEXT_PADDING + i32(buffer.cursor_col) * app.char_width
cursor_y := y
sdl.SetRenderDrawColor(app.renderer, app.config.colours.cursor.r, app.config.colours.cursor.g, app.config.colours.cursor.b, app.config.colours.cursor.a)
sdl.SetRenderDrawColor(
app.renderer,
app.config.colours.cursor.r,
app.config.colours.cursor.g,
app.config.colours.cursor.b,
app.config.colours.cursor.a
)
cursor_rect := sdl.Rect{cursor_x, cursor_y, 2, app.char_height}
sdl.RenderFillRect(app.renderer, &cursor_rect)
}