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

Diagnose input preprocessor failures (#258) #315

Merged
merged 4 commits into from
Jan 17, 2023
Merged

Conversation

eggert
Copy link
Contributor

@eggert eggert commented Dec 26, 2022

This pull request fixes issue #258 - it's like the patch proposed near the end of that issue, except updated so that it merges nicely with the master branch of 'less'.

main.c Outdated
@@ -409,6 +409,7 @@ quit(status)
else
save_status = status;
quitting = 1;
edit((char*)NULL);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of moving the edit() call up here? I think this will break --redraw-on-quit, since the file will be closed when repaint() is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the edit call up so that the diagnosis of the input preprocessor failure would appear in the prompt line on the user's screen. With the edit call where it is in less master, the file is closed and less moves on so the diagnostic message never appears on the user's screen.

Thanks for mentioning the --redraw-on-quit issue. To fix that, I updated the pull request to add a function drain_altpipe that diagnoses the input preprocessor failure without doing the rest of the edit call, and to call drain_altpipe at what I hope is the right point, leaving the call to edit alone. The updated pull request also merges from current master.

@gwsw gwsw merged commit 697a6f0 into gwsw:master Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants