Skip to content

Commit

Permalink
Mark file as dirty if we corrected line endings. (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonbits authored Mar 29, 2024
1 parent 82573ae commit 92857c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Binary file modified bin/aed.bin
Binary file not shown.
4 changes: 1 addition & 3 deletions src/text_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@ static bool tb_read(char fh, char tab_size, text_buffer* tb, int sz) {

// Now I need to update lb_ line buffer with the correct values.
// There might be cases where the line endings are not \r\n so we correct for them.
//bool saw_r = false;
//bool saw_n = false;
int xpos = 0;
int added = 0;
for (int i = 0; i < sz; i++) {
Expand Down Expand Up @@ -421,7 +419,7 @@ static bool tb_read(char fh, char tab_size, text_buffer* tb, int sz) {
}

cb_prev(cb, sz+added);
tb->dirty_ = false;
tb->dirty_ = added != 0;

// Now move the line buffer back to the first line.
while (lb_up(&tb->lb_)) ;
Expand Down

0 comments on commit 92857c3

Please sign in to comment.