summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-02 11:26:50 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-02 11:26:50 -0500
commit4ff4d669ccb658b8b48785d37946378a5b29688c (patch)
treea32804722d6172a23504213b2e862e90b1fa636e /ted.c
parentb712ad8c8c949f7b715c593531fdb5f0285014a9 (diff)
big fix with buffer_pos_to_pixels
also started rust highlighting
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ted.c b/ted.c
index 65f4dc5..73e0965 100644
--- a/ted.c
+++ b/ted.c
@@ -168,7 +168,7 @@ static Status ted_open_buffer(Ted *ted, u16 *buffer_idx, u16 *tab) {
// Returns true on success
static bool ted_open_file(Ted *ted, char const *filename) {
u16 buffer_idx, tab_idx;
- if (buffer_is_untitled(ted->active_buffer) && buffer_empty(ted->active_buffer)) {
+ if (ted->active_buffer && buffer_is_untitled(ted->active_buffer) && buffer_empty(ted->active_buffer)) {
// the active buffer is just an empty untitled buffer. open it here.
return buffer_load_file(ted->active_buffer, filename);
} else if (ted_open_buffer(ted, &buffer_idx, &tab_idx)) {