diff options
author | pommicket <pommicket@gmail.com> | 2023-07-18 17:20:11 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-07-19 19:02:27 -0400 |
commit | 6ba52193b95b78c62ea56f54d94a55d0e31504d1 (patch) | |
tree | 9aaff5249db58725d2e39559a902343171074f54 /session.c | |
parent | fb1c8d184156c9af5432a28831b88776f252da91 (diff) |
font fallbacks
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -116,7 +116,7 @@ static char read_char(FILE *fp) { } static bool read_bool(FILE *fp) { - return (bool)getc(fp); + return getc(fp) != 0; } static void write_cstr(FILE *fp, const char *cstr) { @@ -244,6 +244,12 @@ static void session_read_buffer(Ted *ted, FILE *fp) { buffer->selection = read_bool(fp); if (buffer->selection) buffer->selection_pos = buffer_pos_read(buffer, fp); + buffer_pos_validate(buffer, &buffer->cursor_pos); + buffer_pos_validate(buffer, &buffer->selection_pos); + if (buffer->selection && buffer_pos_eq(buffer->cursor_pos, buffer->selection_pos)) { + // this could happen if the file was changed on disk + buffer->selection = false; + } } } |