Skip to content

Commit 89a7ae8

Browse files
committed
Don't print seek error on window size change
1 parent 118ca14 commit 89a7ae8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/display.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ void redraw(struct lotsctl *const ctl) {
107107
// current file position, seeking backwards
108108
int seek_line(struct lotsctl *const ctl, unsigned long target) {
109109
// Seek to beginning of file
110-
if (fseeko(ctl->file, 0, SEEK_SET) < 0) {
111-
status_printf(ctl, "Can't seek file");
110+
if (fseeko(ctl->file, 0, SEEK_SET) < 0)
112111
return 1;
113-
}
114112
ctl->line = target;
115113
if (target == 0)
116114
return 0;
@@ -131,8 +129,10 @@ void move_backwards(struct lotsctl *const ctl, const unsigned long nlines) {
131129
// underflow occurred
132130
if (target >= ctl->line)
133131
target = 0;
134-
if (seek_line(ctl, target) != 0)
132+
if (seek_line(ctl, target) != 0) {
133+
status_printf(ctl, "Can't seek file");
135134
return;
135+
}
136136
redraw(ctl);
137137
}
138138

0 commit comments

Comments
 (0)