Skip to content

Commit

Permalink
Fix bug which retained old EOF position after an ESC-F session.
Browse files Browse the repository at this point in the history
Fix bug which changed ESC-F to plain F after non-abort signal (window resize).
  • Loading branch information
gwsw committed Jul 3, 2012
1 parent 89a2b96 commit 1ea5f00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,17 @@ seekable(f)
return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK);
}

/*
* Force EOF to be at the current read position.
* This is used after an ignore_eof read, during which the EOF may change.
*/
public void
ch_set_eof()
{
ch_fsize = ch_fpos;
}


/*
* Initialize file state for a new file.
*/
Expand Down
4 changes: 3 additions & 1 deletion command.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,13 +976,15 @@ forw_loop(until_hilite)
forward(1, 0, 0);
}
ignore_eoi = 0;
ch_set_eof();

/*
* This gets us back in "F mode" after processing
* a non-abort signal (e.g. window-change).
*/
if (sigs && !ABORT_SIGS())
return (A_F_FOREVER);
return (until_hilite ? A_F_UNTIL_HILITE : A_F_FOREVER);

return (A_NOACTION);
}

Expand Down

0 comments on commit 1ea5f00

Please sign in to comment.