diff options
| author | WormHeamer | 2025-12-31 03:20:25 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-31 03:20:25 -0500 |
| commit | 79f562d94a908d3ebfc9ac68a577dbc70f12c450 (patch) | |
| tree | fb37f0650dbb0041f273fe7427c6e7181f40d45d /txt.c | |
| parent | a06101376e750a7ba57857a6ed6917e9e5503d71 (diff) | |
allow opening multiple files at once + replace modes
Diffstat (limited to 'txt.c')
| -rw-r--r-- | txt.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -127,6 +127,7 @@ loop: goto loop; } ASSERT(txt_valid_loc(l)); + l.t->dirty = 1; return resolve_loc(l); } @@ -229,6 +230,13 @@ done: return 0; } +void txt_load_empty(Txt *b) { + memset(b, 0, sizeof(Txt)); + txt_buf_fit(b, TXT_SRC, 32); + txt_buf_fit(b, TXT_ADD, 8192); + txt_insert_piece(b, 0, TXT_ADD, 0, b->len); +} + int txt_save(Txt *t, const char *path) { FILE *f = fopen(path, "wb"); if (!f) return -1; @@ -239,6 +247,7 @@ int txt_save(Txt *t, const char *path) { } int e = ferror(f); fclose(f); + t->dirty = 0; return e ? -1 : 0; } |
