Skip to content

Commit

Permalink
Fix display bug when using +:n +:p +:x or +:d on the command line.
Browse files Browse the repository at this point in the history
Was missing calls to cmd_exec() before executing some commands.
This is necessary to clear the string on the command line.
Related to #552.
  • Loading branch information
gwsw committed Aug 3, 2024
1 parent b7573ba commit 469b79e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

* Fix display bug when file contains ESC followed by NUL (github #550).

* Fix bug when using +:n +:p +:x or +:d on the command line (github #552).

======================================================================

Major changes between "less" versions 661 and 662
Expand Down
4 changes: 4 additions & 0 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,7 @@ public void commands(void)
#endif
if (number <= 0)
number = 1;
cmd_exec();
if (edit_next((int) number))
{
if (get_quit_at_eof() && eof_displayed() &&
Expand All @@ -2000,6 +2001,7 @@ public void commands(void)
#endif
if (number <= 0)
number = 1;
cmd_exec();
if (edit_prev((int) number))
{
parg.p_string = (number > 1) ? "(N-th) " : "";
Expand Down Expand Up @@ -2063,6 +2065,7 @@ public void commands(void)
*/
if (number <= 0)
number = 1;
cmd_exec();
if (edit_index((int) number))
error("No such file", NULL_PARG);
break;
Expand All @@ -2075,6 +2078,7 @@ public void commands(void)
break;
old_ifile = curr_ifile;
new_ifile = getoff_ifile(curr_ifile);
cmd_exec();
if (new_ifile == NULL_IFILE)
{
bell();
Expand Down

0 comments on commit 469b79e

Please sign in to comment.