Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #235 #530

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix #235 #530

wants to merge 2 commits into from

Conversation

cero1988
Copy link

fix #235

@gwsw
Copy link
Owner

gwsw commented Jun 13, 2024

The problem I see with this commit is the user experience is poor if the user tries to manually set a mark in the help file. Any command entered after a mark command is ignored:

  1. Run less.
  2. Press h. The help page is displayed.
  3. Press m. The mark command is ignored as it should be.
  4. Press any letter representing a valid command, such as / to start a search or q to exit help. It is silently ignored, which is likely to be unexpected and confusing.

@gwsw
Copy link
Owner

gwsw commented Jun 13, 2024

This modification of your patch might work better, but I haven't fully tested or analyzed it yet.

@@ -2085,7 +2085,11 @@ public void commands(void)
             * Set a mark.
             */
            if (ch_getflags() & CH_HELPFILE)
+           {
+               if (ungot != NULL)
+                   getcc();
                break;
+           }
            start_mca(A_SETMARK, "set mark: ", NULL, 0);
            c = getcc();
            if (is_erase_char(c) || is_newline_char(c))

@cero1988
Copy link
Author

I completely agree, this is a better solution.
The patch also seems to be working well after I tested it.

@gwsw
Copy link
Owner

gwsw commented Jun 25, 2024

Fixed in f0eb3ee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop in the help
2 participants