diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 15:09:49 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 15:09:49 -0500 |
commit | a1646d84127a199fdacb6c5500d96e8829ebe8c1 (patch) | |
tree | eb7d59e50813108105a5bc4539191a3b008a320d /buffer.c | |
parent | d5488ef5c47878e04045a91d204cf1ccbdd9cd05 (diff) |
:shell, bugfixes
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2387,6 +2387,7 @@ void buffer_render(TextBuffer *buffer, Rect r) { rgba_u32_to_floats(colors[COLOR_TEXT], text_state.color); buffer->first_line_on_screen = start_line; + buffer->last_line_on_screen = 0; for (u32 line_idx = start_line; line_idx < nlines; ++line_idx) { Line *line = &lines[line_idx]; if (arr_len(char_types) < line->len) { @@ -2429,6 +2430,7 @@ void buffer_render(TextBuffer *buffer, Rect r) { text_state.y += text_font_char_height(font); column = 0; } + if (buffer->last_line_on_screen == 0) buffer->last_line_on_screen = nlines - 1; arr_free(char_types); @@ -2544,3 +2546,12 @@ void buffer_dedent_selection(TextBuffer *buffer) { buffer_dedent_lines(buffer, l1, l2); } +void buffer_indent_cursor_line(TextBuffer *buffer) { + u32 line = buffer->cursor_pos.line; + buffer_indent_lines(buffer, line, line); +} +void buffer_dedent_cursor_line(TextBuffer *buffer) { + u32 line = buffer->cursor_pos.line; + buffer_dedent_lines(buffer, line, line); +} + |